0

I found this below which explains my situation but the code does not work in my function file. Any help is appreciated. trying to remove the "all posts" category from the post but not from the list on the right. https://www.nicpartners.com/news-insights/

Let’s take another scenario. Sometimes we assign categories to posts or pages for internal management purposes. Let’s say for example, that you want to display certain posts with a different background color, or a different type of font. To do this, you create a special category called “Formatted”. And you code your site so that all posts that fall into the “Formatted” category, are styled differently.

In such a situation, you don’t want the “Formatted” category to be visible to your users. Of course, it might so happen that all “Formatted” posts have a similar theme, but they may not. In any case, it makes no sense to someone who doesn’t understand the purpose and isn’t user friendly. So while we want all the other categories to show up in the list of categories to which the post belongs, we want to exclude “Formatted”. And perhaps a few others as well.

0
$terms = get_terms( 'taxonomy_name', array( 
                        'orderby' => 'name',
                        'order'   => 'ASC',
                        'exclude' => array( 77, 71 ),
) );

reference: original answer: Dave Romsey @wordpress.stackexchange.com

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.