0
votes

I have the following doubt related to the WordPress posts showed in the home page.

I know that in the home page I can show the latest published posts. But can I also show (before the latest posts) a specified number of "important" posts?

What can I do to implement this feature in my blog?

Tnx

2
Important Posts in the sense of most viewed ? or particular category ? or by particular author? Which is your pick?Gunaseelan
featured posts, post that have to be shown first because are important informationsAndreaNobili
Create a category "Important" and then you can assign posts to that category and use a custom query to display them on the homepage.ssergei

2 Answers

1
votes

You could either:

  • Set up a featured category and only include that category on the loop in the homepage.

  • Or, set posts as sticky posts and only show them on the homepage.

The first option would be my preferred solution. You would just need to add a query before the loop that references the category you want to show.

<?php $query = new WP_Query('cat=3'); ?>
<?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>

You would need to reset the query after the loop as well

<?php wp_reset_query();?>
0
votes
  1. Downoad super post plugin : https://wordpress.org/plugins/super-post/

  2. Go to Dashboard>Appearence>Widgets

  3. Select the Super Post widget and drag it to sidebar

  4. Expand Super post set IMPORTANT as title and select the type of post you want in it, the options are: Recent, most commented, sticky, related, Taxonomy: category or tags.

  5. Choose category or tags, link the post that are important to the new category and it will show up. Hope that was what you were looking for