Hello. I’m hoping you can help. I am working on my 5th website using X-Pro; but, I understand if this request is out of scope for providing me with support on this issue (?)
I’m using “The Grid” extension that was available for download with X-Pro to create a page showing all of the Posts. As you can see in the capture attached, some posts contain the “Featured” Category, along with the primary Post category (Tech, Finance, etc.). I am trying to hide this “Featured” item label, so it does not appear in the grid.
I’ve tried every possible CSS selector to isolate and hide just the Featured category, but I cannot get it to work. I’ve also tried using the code below in the functions.php file of the Child Theme, but this code is only applicable to the Home Page, which is not the page I’m using to display my posts. I’ve tried changing the page name “home” (in the PHP below) to the actual page name (News Articles) using the permalink name “news-articles” but that does not work either.
I don’t know PHP, so I’m at a bit of a loss here. This is literally the last thing I need to do to release the website to my client to go live. Any assistance you can provide will be appreciated.
PHP Code:
function excludeCat($query) {
if ( $query->is_home ) {
$query->set(‘cat’, ‘-2’);
}
return $query;
}
add_filter(‘pre_get_posts’, ‘exclude_category_home’);
