Second line in subtitle?

Hi,

Absolutely love this theme and I’ve figured out most of my problems in the forum. I can’t figure out (if it’s possible), how to add a second line to the subtitle in the header slider for the first slide? I’ve stopped the text slider from rotating, I just want 3 lines of text:

Welcome to ****** (maintitle)
Coming very soon. (subtitle)
One more sentence here. (subtitle 2)

The website is www. agrastar .com

Thanks!

Hi,

You’ll need to change the code of the slider template in order to achieve this. You’ll find the function that outputs the slider in the slider.php file. You’ll notice it’s pluggable so you can overwrite it from a child theme. It’s not hard to do, but you need to know your way around code.

Hi Vlad,

Thanks for the quick response! It took me a little while to get the child theme to run, but it’s going now. I have the slider.php file open, but I’m not sure what to “plug in” as you said. I tried to copy/paste the slider_subtitle_1 and create another subtitle under the first slider image, but that didn’t work. Obviously I don’t really know what I’m doing, can you help tell me what to add to the code?

Thanks!

You have a functions.php file in your child theme, correct?
From slider.php, copy everything between function sydney_slider_template() { and the last } (right above the closing endif;. Paste this in your child theme’s functions.php. Then find the first <p class=“subtitle”> and add right below it <p class=“subtitle”>Your text here</p>. I don’t know how this will turn out in terms of styling though.

Thank you!!! That worked!

Cool. Ratings are appreciated if you get the chance: https://wordpress.org/themes/sydney/ :slight_smile:

Hi,

Sorry, I wanted to do almost the same thing, but it seems that the modification I did on the code is not executed.

Here’s what I did:

  • I created a child theme;
  • I copy-paste the function sydney_slider_template() in the child’s ‘functions.php’ file as described above;
  • I added some code after the initialisation of the variables $slider_title_x and $slider_subtitle_x:
    $slider_title_1 = str_replace(' | ', '<br />', $slider_title_1);

I activated my child theme, and in the theme customiser, I wrote a title for the first silde, with a pipe in the middle.
What is expected, is that my overriden function replace the pipe with a line break, but instead, I have my title with the pipe.

Did I forgot to do something ? (I hope i gave enough details!)

Thank you so much. This really worked. There is only one problem I have. I realize there is enormous space between the first subtitle and the second subtitle. It also made the main title go up too close. Here is my website http://www.chearja.com/

One more thing too! I would love if I could reduce the font size of ONLY the second subtitle that I have just created. (JCB, Komatsu & John Deere)

I have said this before in another post but I love this theme man. Its really great.