Full Width Slider on Sidebar Template

Hello,

with the Slider Revolution plugin it is possible, to habe a page with a sidebar template, but still have a full width slider at the top. This can be done through choosing the slider in the page options.´at the lower left. However, I want to use a different plugin for sliders (Smart Slider 3 Pro). With this, I can’t select the slider in the options. I have to put in the code manually on the page. However, that way the slider doesn’t appear in the header section, thus it’s not full width with the sidebar layout.

Can this be done any way? I want to have the Smart Slider 3 Pro slider full width on one single page (not all the pages) that has a sidebar template.

Hello @Muller,

Thanks for asking. :slight_smile:

You can select the slider from options only if you are using Revolution Slider plugin. As you are using a different plugins and the requirement is to display slider only on one page that has sidebar template, you will have to use conditional tags. To learn more, please take a look at following tutorials. After that please make sure you are using the correct shortcode and code to output slider. More information in following tutorial. Please note that providing custom development solutions, falls outside the scope of support we offer.

https://codex.wordpress.org/Conditional_Tags

https://developer.wordpress.org/reference/functions/do_shortcode/

That being said, my recommendation would be to use Revolution Slider plugin as it’s already been integrated with the theme and there’s no coding or custom development required. All that needs to be done is create the slider in Revolution Slider and then select the slider in page options under Slider Settings: Above Masthead select the slider.

You can install Revolution Slider from X > Validation > Extensions. Please take a look at following resource to learn more about Revolution Slider. To help you get started, I have recorded a screencast that you can take a look.

Thanks.

Hello @Prasant,

thank you for replying. My customer insist on using a different slider than the Revolution Slider, because the latter slows down his site a bit.

If anyone tries to do something similar: I built this very simple code which can used to include a slider on single pages. The “case” catches the pages ID, then the “do_shortcode” applies the shortcode. The function is added to the x_after_view_header_base hook, so it will be echoed right after the header.

function custom_headers() {
switch ( get_the_ID() ) {
	case 24:
		echo do_shortcode( '[smartslider3 slider=6]' );
		break;
	case 12:
		echo do_shortcode( '[smartslider3 slider=4]' );
		break;
	}
}

add_action( 'x_after_view_header_base', 'custom_headers', 20 );

Hi,

Thanks for sharing your code.

Have a nice day! :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.