Wordpress Sticky Post

Adhesive Wordpress Mail

Highly useful for temporarily or permanently displaying a sticky note. Which are sticky posts, how to use and design them, and which plugins can improve their functionality? class="mw-headline" id="Function_Reference">Function reference The Sticky Mail function was implemented in version 2.7. There is a control in the Administration > Mail > Add New screen (in the Public area under Visibility.

Click Modify to see the control). When this option is enabled, the post will be placed at the top of the post title page and kept there until new postings are made.

Note that this function is only available for the built-in mail and not for user-defined mail items. Use $sticky = get_option('sticky_posts'); $query = new WP_Query('p=' . $sticky[0] ); display only the first sticky post if nobody returns the last post published: 'posts_per_page' => 1, 'post__in' => get_option( 'sticky_posts' ), ) ) ); $query = new WP_Query( $args ); display only the first sticky post if nobody returns nothing:

Use $sticky = get_option('sticky_posts');'posts_per_page' => 1,'post__in' => $sticky, ); $query = new WP_Query( $args); // add your things here. View the 6 most recently posted articles, and if any of these 6 articles is sticky, they are in.

_per_page_' => 6, ); $query = new WP_Query($args); _per_page_' => 6, ); $query = new WP_Query($args); all sticky items excluded from search: b = $query = new WP_Query( array('post__not_in' => get_option('sticky_posts' ) ) ) ) ) ) ) ); excluding sticky items from a group. Delivers ALL contributions within the class, but shows no sticky contributions at the top.

The' sticky posts' are still displayed in their normal positions (e.g. by date): $query = new WP_Query('ignore_sticky_posts=1&posts_per_page=3&cat=6'); exclude sticky post from a category. Hold'sticky posts' in their original state. Returns contributions within the class, but excludes sticky contributions entirely and follows the page rules: $paged = get_query_var( 'paged') ) ? ? get_query_var( ' paged') ): 1; $sticky = get_option('sticky_posts' );'cat' => 3,'ignore_sticky_posts' => 1,'post__not_in' => $sticky, ); $query = new WP_Query( $args); Note: Use get_query_var('page') if you want this request to work in a page style sheet that you have defined as your statically loaded title page.

Use $sticky = get_option('sticky_posts'); rsort( $sticky); $sticky = array_slice( $slicey, 0, 5 ); $query = new WP_Query( array('post__in' => $sticky,'ignore_sticky_posts' => 1 ) ); To help topic writers with the easier layout, use the post_class() feature to append class="......" to DIV: These include several different value classes: post, for hAtom microformats, category-X (where this is the slot of each class the post is in) and tag-X (similar but with tags).

Also, it will add "sticky" for contributions that are flagged as sticky contributions. Hint: The category "sticky" is only added for sticky mails on the first page of the homepage (is_home() is real and is_paged() is false).

Auch interessant

Mehr zum Thema