Our premium themes come with built-in Sliders with options to display it only on Homepage or on all website pages:
- Login to your Admin Panel
- Navigate to Left Menu -> Appearance -> Customize -> ‘Slider’ Section
- Check ‘Display Slider in Home Page’ or ‘Display Slider in All Website Pages’ checkboxes
- Save Changes
In some cases you may want to display the Slider on All Website pages and hide it only for certain pages. Here is a guide how it can be done:
Make Sure Slider is Displayed on All Pages
First, you need to display the Slider on all pages:
- Login to your Admin Panel
- Navigate to Left Menu -> Appearance -> Customize -> ‘Slider’ Section
- Check the ‘Display Slider in All Website Pages’ checkbox
- Save Changes
Get Page/Post IDs on which you want to hide Slider
The second step is to get a list of pages or posts IDs on which you want to hide the slider.
You can get a Page or Post ID by opening the page or post in Admin Panel for edit, then copy the ‘post’ value from the URL, i.e.
Add Functionality to Skip Displaying of Slider for Post IDs
The last step is to add a small code change which actually skips displaying of slider for specific post IDs:Login to your Admin Panel
Navigate to Left Menu -> Appearance -> Theme Editor
Open header.php (Theme Header)
Replace the below code:
<?php if ( tishonator_should_display_slider() ) :
with:
<?php if ( tishonator_should_display_slider()
&& !in_array( get_the_ID(), array('1676', '1677', '1678') ) ) :
where 1676, 1677, 1678 are posts IDs from previous step.
Save Changes