Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #269503

    Hello,

    is there any way to hide specific categories in the main blog.

    E.g. I do not want to display the category 28 in the main blog.

    I tried several tricks, like editing the functions.php:

    function exclude_category($query) {
    if ( is_page_template('blog.php') ) {
    $query->set('cat', '-104');
    }
    return $query;
    }
    add_filter('pre_get_posts', 'exclude_category');

    did not work…. Probably I did not get the template name right or it has to be done some special way with avia-framework….

    #269767

    Hi,

    Can you post the link to your main blog page please?

    Regards,
    Josue

    #269773

    Hi Josue,

    your are probably my rescue!

    zahnarzt-stuttgart.tv/blog

    #269786

    Hey!

    Try this plugin:
    https://wordpress.org/plugins/ultimate-category-excluder/

    Worked for me on my local install.

    Best regards,
    Josue

    #269817

    Perfect, thank you. That plugin did the job, before I tried WP Hide Post, but that did not work.

    #269818

    You are welcome, glad we could help :)

    Regards,
    
Josue

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