Highlight a Featured Post?

I would like to “highlight” a featured post above all other posts with a special indicator. Is there a feature in WordPress that will do this or do I need to install a third party plug-in? I am using a custom WordPress install (not WP hosted). 1 Answer 1 Use the “sticky” feature. In the … Read more

Set sticky posts schedule (Automatic)

EDIT: It is currently working when I set a sticky post and set it’s date at 07/07/2016. My code so far: I’ve added this to change the post date of the post when it become sticky : // Update post timestamp $newdate = current_time(‘mysql’); $my_post = array( ‘ID’ => $post_id, ‘post_date’ => $newdate ); wp_update_post($my_post); … Read more

Exclude sticky post from main query?

I am having alot of trouble with this. I was using <?php query_posts( array( ‘post__not_in’ => get_option( ‘sticky_posts’ ), ‘paged’ => get_query_var( ‘paged’ ) ) ); ?> to exclude the posts from the main query on the my homepage because stickies are being used in the slider. I am making this theme for wordpress.org and … Read more

Query *only* sticky posts

I’ve been using the following query to try to output only posts that are marked as stickies: <?php $args = array( ‘post_type’ => ‘post’, ‘posts_per_page’ => 2, ‘post__in’ => get_option(‘sticky_posts’) ); ?> <?php query_posts($args); ?> <?php if(have_posts()) : ?> <?php get_template_part(‘loop’, ‘feed-top-stories’ ); ?> <?php endif; ?> <?php wp_reset_query(); ?> I currently have no posts … Read more

WP_Query: Why is sticky post not first item in loop?

I’ve got a custom WP_Query loop based of meta_value variables: $meta_cat = get_sub_field(‘category’); $posts = new WP_Query( array( ‘cat’ => $meta_cat, ‘posts_per_page’ => get_sub_field(‘recent_ppp’), ) ); But somehow when I’ll make a post sticky it isn’t shown as the first item in the while loop. I know ignore_sticky_posts is default set to false so I … Read more