• Resolved jazzbrew

    (@jazzbrew)


    Hello,

    I would like to have the slider display on my home page but I am using the recent posts page. I added the code below to my header:

    <?php echo do_shortcode('[metaslider id="419 restrict_to=home"]'); ?>

    But that hides it from all of my pages. Not using the restrict_to option causes it to show up on all pages. Is there a way for the slider to only appear on the recent posts page?

    Thanks.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    The code you have there looks wrong, try this (notice the change of “):

    do_shortcode('[metaslider id="419" restrict_to="home"]')

    If still not working, you can wrap it in a conditional like this and it will only show on the blog page.

    <?php
    if (is_home()) {
      echo do_shortcode('[metaslider id="419 restrict_to=home"]');
    }
    ?>
    Thread Starter jazzbrew

    (@jazzbrew)

    You’re right — it was the first issue. I didn’t have double quotes around both parameters. Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using Recent Posts as Home’ is closed to new replies.