New Topic

Reply To: Nivo Slider

Home › Forum › Plugins › Nivo Slider › Reply To: Nivo Slider

#970

StartupWP
Keymaster

We’ll need to setup a child theme in order to manipulate the header.php code.

1. Setup a child theme: https://startupwp.com/topic/child-theming/

2. Copy over header.php from the parent theme to the child theme.

3. Find this line:

<?php if ( $options['slider'] ){ echo '<div id="slider">'.do_shortcode('[nivoslider slug="slider"]').'</div>'; } ?>

4. Replace with:

<?php
if ( is_home() && $options['slider'] ) {
echo '<div id="slider">'.do_shortcode('[nivoslider slug="slider"]').'</div>'; 
elseif ( is_page(28) ) {
echo '<div id="slider">'.do_shortcode('[nivoslider slug="pro-liability"]').'</div>'; 
}  elseif ( is_page(30) ) {
echo '<div id="slider">'.do_shortcode('[nivoslider slug="gen-liability"]').'</div>'; 
}  elseif ( is_page(83) ) {
echo '<div id="slider">'.do_shortcode('[nivoslider slug="forced-prop"]').'</div>'; 
}  else  {
}
?>

As you can see we’ve prepared the code for the programs you have so far. 28, 30 and 83 correlate to the page’s ID. The slider slugs are a more human-friendly way of indicating what slider it should be.

5. Create the new sliders under the Nivo Slider options with the appropriate slugs.