Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1354990
    Peter Fae
    Participant

    hey. I want to exclude certain categories from the category dropdown, but still have access to it through the Posts – Categories dashboard. Basically, I have an ‘Under Construction’ category for myself but don’t want my readers to see that.

    thanks!

    #1355090
    Christian
    Moderator

    Hey Peter,

    Please give us the URL of the page where we can find your category dropdown. Also provide a screenshot.

    Thanks.

    #1356233
    Peter Fae
    Participant
    #1356393
    Lely
    Moderator

    Hello Peter,

    Please add the following code on your child theme’s functions.php file.

    //Hide categories from WordPress category widget
    function exclude_widget_categories($args){
        $exclude = "1,2,3,4";
        $args["exclude"] = $exclude;
        return $args;
    }
    add_filter("widget_categories_args","exclude_widget_categories");

    Replace “1,2,3,4” with your own category IDs.

    Hope this helps.

    #1362396
    Peter Fae
    Participant
    #1362527
    Christopher
    Moderator

    Hi there,

    Please add following code in Customize -> Custom -> Global CSS :

    .widget_categories option.level-0[value="279"] {
        display: none;
    }

    Hope that helps.

    #1365549
    Peter Fae
    Participant

    do I also need to add the code to the functions component of my child theme or leave that out?

    #1365552
    Peter Fae
    Participant

    also … not working.

    #1365642
    Lely
    Moderator

    Hi Peter,

    Look for this part:

    /*
    .page-id-3583 .x-post-carousel {
    	display: none;
    }

    Update to this:

    
    .page-id-3583 .x-post-carousel {
    	display: none;
    }

    /* */ That is a syntax for multiple line comments. Please make sure that everything has closing. /* will look for the closing tag for comment thus will make CSS after that from working. Check other parts to for any error.

    Hope this helps.

  • <script> jQuery(function($){ $("#no-reply-1354990 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>