user1767647
user1767647

Reputation:

WordPress hiding category specific html

I'm looking for a way to hide a "form" drop down menu in WooCommerce but only on a specific category page. We'll call it "marbles", the drop down to select the ordering of items I would like to not appear, but on the category "apples" and other pages I would like for it to remain visible. I've tried using code similar to #category-id-15 form.woocommerce-ordering {display: none;} but that didn't seem to do the trick. Can this be done using CSS only or would I need to create an action for it?
Here's the page I'm trying to hide the drop down menu on -
CATEGORY PAGE

Upvotes: 1

Views: 514

Answers (1)

Adib Aroui
Adib Aroui

Reputation: 5067

You can hide it using CSS. But Wordpress offers a function is_category() to do such operations .

In your category.php file, try using this:

 if (!(is_category('marbles'))){
        include(TEMPLATEPATH.'/part.php'); 
    }

where part.php is the php code where you have your drop down menu.

I am here to provide with more support.

Upvotes: 0

Related Questions