• barnez

    (@pidengmor)


    Hi,

    I am using the Academica theme and have a dynamic LayerSlider slider in the header of the homepage, using the following code in the header.php file:

    <?php if(is_page('51')){
    echo do_shortcode('[layerslider id="1"]');
    }
    else{
    ?>

    What I would like to do is replace the static header in the rest of the site (all other pages/posts but not the homepage) with the same image but inside the slider wrapper. The slide is set up and the shortcode is [layerslider id=”4″].

    The documentation suggests that you can add a slider to selected pages by using the following code:

    <?php layerslider(3, 'homepage,about-us,1234'); ?>

    Do I need to add all the page/post IDs or names individually, or is there a simpler way that will insert the slider into all pages/posts except the homepage, and importantly into all new posts that are published?

    The site is https://www.englishlc.com/

Viewing 1 replies (of 1 total)
  • Thread Starter barnez

    (@pidengmor)

    Have tried replacing the code with this,

    <?php if(is_page('51')){
    echo do_shortcode('[layerslider id="1"]');
    } else {
    echo do_shortcode(‘[layerslider id="4"]’);
    } ?>

    but it probably needs tidying as the page will not load as it stands.

Viewing 1 replies (of 1 total)
  • The topic ‘Adding new slider to all pages/posts except the homepage’ is closed to new replies.