Home Forums Free Themes Photo Perfect Set categories of posts to show, not 'all'

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #108872
    Linda Erlam
    Participant

    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?

    #108902
    wensolutions
    Keymaster

    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.

    #108910
    Linda Erlam
    Participant

    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

    #108949
    wensolutions
    Keymaster

    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.

    #108960
    Linda Erlam
    Participant

    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?

    #109082
    wensolutions
    Keymaster

    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.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.