Webriti Support Forum
WordPress Premium Themes
How can I get the latest news on the home page to only show posts in a specific category?
kindly confirm, means you want to show posts on the homepage of a specific categories only.
So rather than all posts, what if I just wanted the latest news widget to show the most recent posts from the "featured" category?
This feature to show posts of specific categories is not included in the theme. However, you can do this but you need to add some code manually in a file.
Follow the below steps:
1) Install a plugin
if not created.
Copy the file
from parent theme of Rambo & paste it in the child theme.
4) Now edit the file, at line no. 17 you will notice this below line
$args = array( 'post_type' => 'post','posts_per_page' =>$no_of_post,'post__not_in'=>get_option("sticky_posts"));
In that line, add one more parameter & it become like this. Or replace the whole line with below line
$args = array( 'post_type' => 'post','posts_per_page' =>$no_of_post,'post__not_in'=>get_option("sticky_posts"),'cat'=> '7,8');
You will notice only
is added. where the value 7 & 8 are two category Id which you want to show on homepage posts.
Above plugin add one column which reveals ID like this
This way you can customize feature to show only specific categories on homepage.
Let me know if further need assistance.
Glad to know it is useful to you.
Any query later, feel free to ask again!
We would really appreciate if you could provide us a kind review here:
This discussion has been closed.