• I would like to add some more sliders to the default number of 5 preset of the Sydney theme.
    I know that there is some coding to do and something to add to some .php file, yet I do not know where and how.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi @albertomiotti,

    I hope you are doing well today.

    To add extra slides, you would need to edit the theme’s file (inc/slider.php). In that file, go to sydney_slider_template() line. Then add your slides HTML code right after loop statement. Ref: https://i.snipboard.io/yfdkhu.jpg

    Here is HTML example for 3 additional slides:

    <!-- Slide 6 -->
    <div class="slide-item slide-item-6" style="background-image:url('YOUR_IMAGE_URL');">
      <img class="mobile-slide preserve" src="YOUR_IMAGE_URL" alt="" />
      <div class="slide-inner">
        <div class="contain animated fadeInRightBig text-slider">
          <h2 class="maintitle">Welcome to Sydney</h2>
          <p class="subtitle">Feel free to look around</p>
        </div>
        <a href="#primary" class="roll-button button-slider">Click to begin</a>
      </div>
    </div>
    
    <!-- Slide 7 -->
    <div class="slide-item slide-item-7" style="background-image:url('YOUR_IMAGE_URL');">
      <img class="mobile-slide preserve" src="YOUR_IMAGE_URL" alt="" />
      <div class="slide-inner">
        <div class="contain animated fadeInRightBig text-slider">
          <h2 class="maintitle">Welcome to Sydney</h2>
          <p class="subtitle">Feel free to look around</p>
        </div>
        <a href="#primary" class="roll-button button-slider">Click to begin</a>
      </div>
    </div>
    
    <!-- Slide 8 -->
    <div class="slide-item slide-item-8" style="background-image:url('YOUR_IMAGE_URL');">
      <img class="mobile-slide preserve" src="YOUR_IMAGE_URL" alt="" />
      <div class="slide-inner">
        <div class="contain animated fadeInRightBig text-slider">
          <h2 class="maintitle">Welcome to Sydney</h2>
          <p class="subtitle">Feel free to look around</p>
        </div>
        <a href="#primary" class="roll-button button-slider">Click to begin</a>
      </div>
    </div>

    In that code, replace YOUR_IMAGE_URL with your image URL, that you can get from media library (Dashboard > Media).

    Please note that this file change will be wiped out when you update the theme in the future. So you will need to do this change again after updating.

    I’d recommend doing this in your non-production site to avoid any error while working with coding. Please test it first before deploying it to your production or live site.

    Thread Starter albertomiotti

    (@albertomiotti)

    Thanks a lot, if I remember well a couples of year ago I found another way to make it, by changing some code like:

    ‘slider_subtitle_5’ => get_theme_mod(‘slider_subtitle_5’),

    and then typing the guide text like “Please choose the image to insert” and so on…

    Thread Starter albertomiotti

    (@albertomiotti)

    I mean, I inserted new lines in the menu in the left column where you edit the Title, the Subtitle, and you pick the image to insert in the slider… so I managed to insert 2 more slides but I think I lost that when I updated the theme (I am using a child theme)

    Hi @albertomiotti,

    Thanks a lot, if I remember well a couples of year ago I found another way to make it, by changing some code like:

    ‘slider_subtitle_5’ => get_theme_mod(‘slider_subtitle_5’),

    Newer version of Sydney has code base changes, that’s why I recommended different approach. Have you tried it? Please confirm.

    Thread Starter albertomiotti

    (@albertomiotti)

    Yes, I have tried to insert the code that you suggested but I get a “fatal error” and the site becomes unaccessible.

    Thread Starter albertomiotti

    (@albertomiotti)

    Any other suggestion?

    Hi @albertomiotti,

    1. Try to access inc/slider.php in your host through File Manager of sFTP
    2. Replace the entire code in that file with https://pastebin.com/raw/UQYhRCmP. It includes additional slides HTML. They are located between
    <!-- Additional slides start -->

    and

    <!-- Additional slides end -->

    3. Replace each YOUR_IMAGE_URL with your image URLs.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Sydney: increase the number of shown slider’ is closed to new replies.