This topic has 2 replies, 2 voices, and was last updated 9 years by shellycs.

  • Author
  • #47762
     shellycs
    Participant

    Hi there,
    Sorry if this is a silly question but I am new to this website building stuff. I am wanting to create a page just for news. I would like to do this as posts but not have the posts appear in the blog section of my website. Do you know if there is an mechanism in the visual composer or shortcode that I can use for this? Or do I need to do some coding (gulp!).
    Thanks in advance 🙂

    #47767
     sharmstr
    Moderator

    Use a category for news. There are built in archive pages that will show every post for a selected category. So, that’s your news page. Example: http://seventhqueen.com/themes/kleo/category/courses/

    But since you dont want them to show up in your normal blog feed, you’ll have do some coding. Do a google search for exclude category from blog.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #47893
     shellycs
    Participant

    Thank you so much…works perfectly!

    I created a new page, used kleo post grid and set it to the category I wanted to show on that page and in the query got it to show all posts. Then I found some code….here’s what I did for anyone else that ever needs to know this:

    function exclude_category($query) {
    if ( $query->is_home() ) {
    $query->set(‘cat’, ‘-66,-71,-70’);
    }
    return $query;
    }
    add_filter(‘pre_get_posts’, ‘exclude_category’);

    ?>

    Thanks again!!!

Viewing 3 posts - 1 through 3 (of 3 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?