I need to display max 5 latest sticky posts that have a thumbnail. And I need to have accurate counting of the displayed posts. I’ve tried to exclude sticky...
This link solves the problem but it’s only for the main query. What if you are using a custom query? How can you modify the answer below: add_action('pre_get_posts', 'ad_custom_query');...
I use the following code to exclude expired posts and it works fine but it doesn’t exclude expired sticky posts. //* Exclude expired posts add_action( 'pre_get_posts', 'exclude_expired_posts' ); function...
I’ve been reading this by @nacin and getting to grips with wp_query over query_posts that I used to use. What I want is: to put this in a template...
I’m using my index.php to display post archive pages rather than a specific archive.php file. This works fine, however sticky posts do not stick to the top of it....
I would like 7 posts showing on my homepage. I would like to be able to manually choose those posts by stickying them. Currently, I have my posts per...
I need to have the ability to have Sticky posts for each category. The simplest way to do this appeared to be to just create two loops on the...
I’m using the default Loop Code. I’ve set the ‘Blog pages show at most’ option in Settings > Reading to 11. In my home page -set to show Latest...
I’m using the following bit of code to highlight sticky posts: <?php if (is_sticky()) : ?> <div class="col-md-12 box-01"> <div class="content"> <?php endif; ?> The only thing is, I...
I need to create a custom WordPress admin interface for a client. I want to completely disable the sticky post feature from admin area. I found some posts on...