Support » Theme: Nisarg » Header Image Slider PHP code location

  • pietr4s

    (@pietr4s)



    Hi There,

    Instead of a static header image i’d like to change it to an image slider. I’m using the Meta Slider plugin and want to use the shortcode or PHP code to display a slider in the header image location. I’ve looked in the “header.php” file but It seems the php code really needs to be in the “custom-header.php” file, I just don’t know where to put it.

    here’s the code for the image slider i’d like to use,
    <?php
    echo do_shortcode(“[metaslider id=184]”);
    ?>

    Hopefully someone has done this before or can help me figure it out! thanks, Peter

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • I was able to use an image slider in my nisarg child theme. I used slider wd but I think any slider plugin should work. Copy theme header to your child then insert your image slider.

    <div class=”site-header”>
    <php wd_slider(3); ?>
    <div class=”site-branding”>

    I disabled it for media screens. It is only on desktop.
    kcsmsar.org

    pietr4s

    (@pietr4s)

    Thank you! It Works. But as you can see the images looks bad. Could you please share me your settings (max width x height etc) and size of the images that you use in your site? Thanks a lot.

    Glad it worked. Your images look pretty good on your website.
    I did the same image sizing in the slider settings as the original header used. 1600x400px for the images and set the slider to the same size.

    pietr4s

    (@pietr4s)

    Could you also tell me how much is your ratio and are you use full width? When I minimalize my page it isn’t look good 🙁

    https://i.imgur.com/0XlRNxi.png

    It looks good to me.
    I left the ratio at the default for the slider. 3.76

    My slider is set to full width when screen is smaller than 1080px. Not sure if that makes a difference to anything since mine is set to disappear at 767px.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Header Image Slider PHP code location’ is closed to new replies.