How to add Layerslider as frontpage header?

Hi!
I want to add a 3rd party slider as my header, the slider provides shortcode like this [layerslider id=“2”] or PHP <?php layerslider(2) ?>

My problem is that i dont know how/where i should put either to get the slider as my header.

Any suggestions?

www.defencelab.se

Hello there,

Try to do the following:

  1. Open the inc/slider.php file
  2. Replace the following code

//Slider template
function moesia_slider_template() { ?>
	<div id="slides">
	    <div class="slides-container">
		    <?php 
			    if ( get_theme_mod('slider_image_1') ) {
					echo '<img src="' . esc_url(get_theme_mod('slider_image_1')) . '">';
				}
			    if ( get_theme_mod('slider_image_2') ) {
					echo '<img src="' . esc_url(get_theme_mod('slider_image_2')) . '">';
				}			
			    if ( get_theme_mod('slider_image_3') ) {
					echo '<img src="' . esc_url(get_theme_mod('slider_image_3')) . '">';
				}
			    if ( get_theme_mod('slider_image_4') ) {
					echo '<img src="' . esc_url(get_theme_mod('slider_image_4')) . '">';
				}
			    if ( get_theme_mod('slider_image_5') ) {
					echo '<img src="' . esc_url(get_theme_mod('slider_image_5')) . '">';
				}				
			?>	
	    </div>
	</div>
	<?php	
}

to


//Slider template
function moesia_slider_template() { ?>
	<div id="slides">
	    <div class="slides-container">

				<?php layerslider(2); ?>

	    </div>
	</div>
	<?php	
}

Let me know how it goes.

P.S.

As you are editing the core theme’s file, you should take it at your own risk. You will loose the changes once the theme gets updated in the future.

Regards,
Kharis