Exclude all sticky posts front page twenty twelve

Don’t use query_posts. Use a filter on pre_get_posts. function no_front_sticky_wpse_98680($qry) { if (is_front_page()) { $qry->set(‘post__not_in’,get_option( ‘sticky_posts’ )); } } add_action(‘pre_get_posts’,’no_front_sticky_wpse_98680′); By running query_posts you clobber the main query, over-writing it with another query. That is why you break pagination. The new query gets out of sync with what should be the main query.

How to get bbpress sticky topics

You can make the query like above using following code. <?php query_posts( array( ‘posts_per_page’ => 2, ‘meta_key’ => ‘_bbp_sticky_topics’, ‘post_type’=> ‘topic’, ‘order’ => ‘ASC’ ) ); if (have_posts()) : while (have_posts()) : the_post(); //do something endwhile; endif; ?> But i strongly recommend you not to alter main query using query_posts() and instead use WP_Query as … Read more

Only display sticky post or latest post in custom loop

You can adapt your first loop to either show a sticky post or the latest post in the following manner: PLEASE NOTE: You have to reset your custom query <?php $args = array( ‘posts_per_page’ => 1, ‘post__in’ => get_option( ‘sticky_posts’ ), ‘ignore_sticky_posts’ => 1 ); $my_query = new WP_Query( $args ); $do_not_duplicate = array(); while … Read more

ignore_sticky_posts not working with word press version 3.9.1

If you want to totally remove the sticky posts from the query, you need to use post__not_in. The Codex has an example, which you can adapt to your needs: $paged = get_query_var( ‘paged’ ) ? get_query_var( ‘paged’ ) : 1; $sticky = get_option( ‘sticky_posts’ ); $args = array( ‘cat’ => 3, ‘ignore_sticky_posts’ => 1, ‘post__not_in’ … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)