Display A div only on a single page

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.

Read More

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.

Related posts

Leave a Reply

2 comments

  1. if it is a custom taxonomy named listing you should use is_tax($tax, $term) instead:

    if ( is_tax( 'listing', 'wedding' ) )  {
        echo do_shortcode('[rev_slider wedding]');
    }
    
  2. 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( is_category( 66 ) ) {
        echo do_shortcode('[rev_slider wedding]');
    }
    

    If you’re using a custom taxonomy, then you can use is_tax in the same way:

    if ( is_tax( 'listing', 'wedding' ) )  {
        echo do_shortcode('[rev_slider wedding]');
    }