I want to display on the main page n the number of news from two types - popular and new. With such a condition that I need to choose which posts to display as the main one and with what label. Here is a prime example of what I want to achieve:


How to do it better?

Saw on one in one template near the post here is: alt text

what is it ? Can it be possible with the help of these "tags" to group the necessary posts and display them in the right place?

PS group by type of posts, categories, tags is not an option.

    2 answers 2

    The easiest way to use the plugin.

    Look at here

    • This is not at all what I need, I need to choose which posts to post on the main one and with what label and not a widget. Above in the post I added an example. - gera
    • This can be done through custom fields: codex.wordpress.org/Custom_Fields And then do a sample in the template: codex.wordpress.org/Template_Tags/get_posts Example sample: $ args = array ('meta_query' => array (array ('key' => 'featured', 'value' => 'yes',))); $ postslist = get_posts ($ args); The meta_query parameter is passed an array with the name of the user field and its desired value. You can also read about all the possibilities of working with custom files: codex.wordpress.org/Class_Reference/… - RaZik
    • Although it is possible to create additional categories (for example: Promotions, Special Offers) and when adding or changing a product, just mark its categories and additional. category. And on the output page, make a selection by id add. categories. And the fact that you have on the screenshot is called custom record fields. What I wrote above. For ease of use, I recommend using a third-party plugin, for example: Advanced Custom Fields - RaZik

    Here is a search by tags, you can see in detail in http://codex.wordpress.org/Class_Reference/WP_Query

    <? $args = array('tag'=>'main','orderby'=>'date','order'=>'DESC') $loop = new WP_Query($args) while($loop->have_posts()) : $loop->the_post(); ?> <h3><a href="<?the_permalink()?>"><?the_title()?></a></h3> <?endwhile; wp_reset_query(); ?>