I was working on a word press theme. I created a slider using revolution slider. I need to display it in my category page named wedding. so i pasted the following code into my header.php
<?php echo do_shortcode('[rev_slider wedding]'); ?>
Now as it is in my header.php the slider is displaying in all pages.
The category listing page has a class named term-66 where 66 is the category id.
So i want to display the slider only in that particular page. Some thing like
if is class .term-66
{
<?php echo do_shortcode('[rev_slider wedding]'); ?>
}
Not sure on applying the above logic or some jquery ?? Please help Thank You.
if it is a custom taxonomy named listing you should use is_tax($tax, $term) instead:
You can use
is_category
to check if the current page is, in fact, the category you’re looking for.You can pass
is_category
a Category ID, Category Title, Category Slug or Array of IDs, names, and slugs, as per the documentation.If you’re using a custom taxonomy, then you can use
is_tax
in the same way: