- This topic has 5 replies, 2 voices, and was last updated 5 years, 1 month ago by .
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- You must be logged in to reply to this topic.
Home › Forums › Free Themes › Photo Perfect › Set categories of posts to show, not 'all'
Is it possible to designate what posts do show? All the posts in the system will show in ‘older posts’, and some I don’t want to show.. like the ‘style guide’ and menu items. If not, can I remove the ‘older posts’ prompt?
Hello,
Actually, we are not quite clear with your query. Can you please provide us with your site URL so that we can help you?
Regards.
I have the front page set, per instructions, to latest posts,
This is so the front page displays images,
I have set the number of images to 3.
If one clicks on ‘older posts’ all the other posts appear.
I have set them all to draft mode so they do not appear, but i may want to use posts in another section, such as staff, at which time I would have to publish the post and then it would appear in ‘older posts’.
I have published one of these so you can see that it appears in ‘older posts’ where it is not wanted.
The site is tinypastryshop.com
Hello,
To show the posts in ‘older posts’ which belong to same category of the posts that appear in front page, please add following given code in functions.php file of your child theme.
function sbt_exclude_category($query){
if ( $query->is_home() && $query->is_main_query() && ! is_admin() ) {
$query->set( 'category_name', 'your-category-name-here' );
}
}
add_action('pre_get_posts','sbt_exclude_category');
Please replace ‘your-category-name-here’ with your category name.
Hope this helps.
If you have any queries further, let us know.
Thank you.
I do not have a child theme. As the main premise of this theme is to showcase photos, via posts, are you saying that ALL posts will show on the latest posts section unless I use a child theme?
Hello,
Yes, all the posts will be shown in latest post section if you do not use child theme. So if you want the feature you have requested in previous query, you have to create child theme and add above given code in functions.php file of child theme.
If you have any queries further, let us know.
Thank you.
Cookie | Duration | Description |
---|---|---|
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |