featuring old articles without messing up with the archive

Use Sticky Posts. In the Post editor find the “Publish” section. Next to “Visibility” click on edit and then check the “Stick this post to the front page” option there. Click save and you’re done. In the loop, you can check if a post is_sticky(). To loop them, you can use the post__in or post_not__in … Read more

Featured Image Inherited from Parent Page

This is my proposal, combine get_ancestors and a custom $wpdb query, to retrieve featured images. An example custom function: function inherited_featured_image( $page = NULL ) { if ( is_numeric( $page ) ) { $page = get_post( $page ); } elseif( is_null( $page ) ) { $page = isset( $GLOBALS[‘post’] ) ? $GLOBALS[‘post’] : NULL; } … Read more

How to get featured post title & image using JSON API?

I made a shortcut to my image by adding it directly to the API response. //Add in functions.php, this hook is for my ‘regions’ post type add_action( ‘rest_api_init’, ‘create_api_posts_meta_field’ ); function create_api_posts_meta_field() { register_rest_field( ‘regions’, ‘group’, array( ‘get_callback’ => ‘get_post_meta_for_api’, ‘schema’ => null, ) ); } //Use the post ID to query the image and … Read more

Is “Featured Content” in Twenty Fourteen done with a plugin, or is it native in WP4.0?

The featured content is part of the TwentyFourteen theme, and is not implemented as a plugin, but rather as an Appearance > Customize setting (via get_theme_mod()), which allows the use of a Grid or Slider layout, choosing posts base on the tag provided. BTW, I figured this out only after reading your post! So thanks … Read more

Keep featured content post in homepage with original order

I think you can use the WPQuery $the_query = new WP_Query( array( ‘post__in’ => get_option( ‘sticky_posts’ )) ); ?> <?php if ( $the_query->have_posts() ) : ?> <!– pagination here –> <!– the loop –> <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <h2><?php the_title(); ?></h2> <?php endwhile; ?> <!– end of the loop –> <!– … Read more