CTA scrolling and Polylang Issues

I’m struggeeling a bit with the latest Theme update. SInce both problems seem to be related I connect them in the same topic.

  1. The smooth scrolling when jumping to the content by pressing the CTA button is gone … it just instantly jumps without scrolling. I found the recommendation to add the class=“smoothscroll” to the href attribut but that did not improve the situation.

  2. Since my SydneyPro Child Theme does not seem to be recognised by polylang I don’t get the various language strings I need for the translations.And yes I added the XML file you provided to the child folder already. So to get it running I added a lot of JS to the custom JS function (but seriously this can not be a long term soloution). Since the href call (see above) is included in the JS section I might have been doing something wrong here?!

Any help would be appreciated
If you check the site, please only play with the german version since the other versions are not implemented yet.

Cheers, Timo

Website: casa.baaij.eu

JS to overcome the unrecognised child theme problem of Polylang and to add a line break in the slider title and subtitle:

jQuery(function($) {

  if( $('.slide-item').length ){

    // Deutsche Texte
    if( $('html[lang="de-DE"]').length ) {
        var slideText1 = 'Willkommen in<br />Sant Carles de la Rapita';
		var slideText1a = 'Heimat der Casa Baaij';
      
        var slideText2 = 'Maritimer Lifestyle';
        var slideText2a = 'Der Geruch von Salz und Fisch';
      
        var slideText3 = 'Nightlife';
        var slideText3a = 'Wenn die Stadt erwacht';
      
        var slideText4 = 'EIn Platz für<br />Erholung und Vergnügen';
        var slideText4a = 'Bars, Parks, Hafen, Natur';
      
        var slideText5 = 'Restaurants';
        var slideText5a = 'Von Takeaway über Tapasbars und<br />Familienrestaurants bis zur Sterneküche';
    } 
    
    else if( $('html[lang="nl-NL"]').length ) { 
    // Niederlänndische Texte
        var slideText1 = 'Welkome in Sant Carles<br />de la Rapita';
		var slideText1a = 'Huis van Casa Baaij';
      
         var slideText2 = 'Maritimer Lifestyle';
        var slideText2a = 'De geur van zout en vis';
      
        var slideText3 = 'Nightlife';
        var slideText3a = 'Wanneer de stad ontwaakt';
      
        var slideText4 = 'Een plaats voor<br />recreatie en plezier';
        var slideText4a = 'Bars, Parken, Haven, Natuur';
      
        var slideText5 = 'Restaurants';
        var slideText5a = 'Van afhaalmaaltijden, familierestaurants<br />tot sterrenkeukens';
    } 
    
    else {
    // Englische Texte
        var slideText1 = 'Welcome to Sant Carles<br />de la Rapita';
		var slideText1a = 'Home of Casa Baaij';
      
        var slideText2 = 'Maritime lifestyle';
        var slideText2a = 'The smell of salt and fish';
      
        var slideText3 = 'Nightlife';
        var slideText3a = 'When the city gets alive...';
      
        var slideText4 = 'A place to enjoy';		
        var slideText4a = 'Bars, parks, the harbour... Just relax';
      
        var slideText5 = 'Restaurants';
        var slideText5a = 'Takeaway, fancy and top notch';
    }
    
    $( '.slide-item:nth-of-type(1) .slide-inner .maintitle' ).html(slideText1);
	$( '.slide-item:nth-of-type(1) .slide-inner .subtitle' ).html(slideText1a);
    
    $( '.slide-item:nth-of-type(2) .slide-inner .maintitle' ).html(slideText2);
    $( '.slide-item:nth-of-type(2) .slide-inner .subtitle' ).html(slideText2a);
    
    $( '.slide-item:nth-of-type(3) .slide-inner .maintitle' ).html(slideText3);
    $( '.slide-item:nth-of-type(3) .slide-inner .subtitle' ).html(slideText3a);
    
    $( '.slide-item:nth-of-type(4) .slide-inner .maintitle' ).html(slideText4);
    $( '.slide-item:nth-of-type(4) .slide-inner .subtitle' ).html(slideText4a);
    
    $( '.slide-item:nth-of-type(5) .slide-inner .maintitle' ).html(slideText5);
    $( '.slide-item:nth-of-type(5) .slide-inner .subtitle' ).html(slideText5a);
    
  }

});

jQuery(function($) {

// Default links and labels
  
  var links = [
    'http://casa.baaij.eu/'
  ];  

  var labels = [
    'Start'
  ];

 if( $('html[lang="de-DE"]').length ) { // Deutsch
    var links = [
      'http://casa.baaij.eu/#start'
    ];
   var labels = [
      'Los gehts'
    ];
 }
 else if( $('html[lang="nl-NL"]').length ) { // Niederländisch
    var links = [
      'http://casa.baaij.eu/nl/casa-baaij-2/#start'
    ];
    var labels = [
      'Hup Hup'
    ];
 }
 else { // Alles andere ist Englisch
    var links = [
      'http://casa.baaij.eu/en/casa-baaij-3/#start'
    ];
    var labels = [
      'Click to begin'
    ];
 }
 var button1 = '<a href="'+links[0]+'" class="roll-button button-slider smoothscroll">'+labels[0]+'</a>'; //Slide 1
 //Hide the default button
  $('.slide-inner a').hide();

  //Add the new buttons. Delete the lines you don't need
  $( '.slide-item:nth-of-type(1) .slide-inner' ).append(button1); //Slide 1
  $( '.slide-item:nth-of-type(2) .slide-inner' ).append(button1); //Slide 2
  $( '.slide-item:nth-of-type(3) .slide-inner' ).append(button1); //Slide 3
  $( '.slide-item:nth-of-type(4) .slide-inner' ).append(button1); //Slide 4
  $( '.slide-item:nth-of-type(5) .slide-inner' ).append(button1); //Slide 5
});

Hi @timobierbaum,

Newer version of Sydney Pro theme has changed the way JavaScript is handled. It may cause trouble on behaviour of some areas when the site is running a child theme, that has header.php file modified from there.

In correspond of the theme update, you’ll need to do some adjustments to your child theme’s header.php file.

Add <?php wp_body_open(); ?> line right after the body tag opening. So your child theme’s header.php will look like this:

    <?php
    /**
     * The header for our theme.
     *
     * Displays all of the <head> section and everything up till <div id="content">
     *
     * @package Sydney
     */
    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <meta charset="<?php bloginfo( 'charset' ); ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="profile" href="http://gmpg.org/xfn/11">
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">

    <?php wp_head(); ?>
    </head>

    <body <?php body_class(); ?> <?php sydney_do_schema( 'html' ); ?>>
    	
    <?php wp_body_open(); ?>

    <?php // Rest of the code ?>

Hope that helps. Let me know your views.

Regards,
Kharis

Well, currently my child theme had no header.php … so I copied the one from the SydneyPro folder into the child theme … seeing that this header.php already had the <?php wp_body_open(); ?> line included.
So there was actually no change in the behaviour …

Should I split the question in two parts? Maybe one part is easier to answer…
Cheers, Timo

Hello Timo,

Sorry for the delay here!

  1. Please try adding the given custom CSS code below at Appearance > Customize > Additional CSS:

    html {
        scroll-behavior: smooth;
    }


  1. Sorry, I am bit confused here. That’s related to the “scroll to section” button, right? I mean, the JS changing the “href”. If yes, the solution above will resolve that.

We hope this helps!

Please try that and let us know if you need further assistance.

Kind Regards,

Rodrigo.

aThemes Support

Hi Rodrigo,
thanks for your answer.

Your CSS code solved part one of my problem - I get a smooth scroll now again. Would you by any chance have an idea how to decrease the speed of the the smooth scroll?

My second problem is related to a topic I had some weeks ago already. In Polylang the translations are not displayed in the string translation. No “group” is shown for the SydneyPro (Child) theme.I already copied the XML file you provided. As well I did some changes in the customization as you recommended last time saved them and checked again. Still the same:

How can I enable the SydneyPro String settings in the polylang String Translations so I can make my page multi language ready?

Frankly spoken I’m really scared updating pages with the new SydneyPro version since I have no idea how to deal with the changes related to the update. I guess it’s OK once you start from scratch - but even there I have doubts if the string translations are shown.

Thanks for you help,
Timo

Hello Timo,

You are welcome!

  1. Regarding decrease the speed fo smooth scroll, unfortunately that’s not possible, since it runs entirely trough CSS and not by a JS code. The purpose of using the scroll with CSS is performance, so the theme don’t need to run JS code and consequently the performance of website is better.

  2. Please try editing the wpml-config.xml file and make sure the key name="xxxx" is the same as folder name from your child theme. For example, if you is child theme folder name is sydney-pro-child, the key name should be <key name="theme_mods_sydney-pro-child">. Probably that’s the issue.

Regarding your concern about the laterst version of Sydney Pro, we made some big changes in the header system, but you can choose if want to go with new header system or continue with the old. If you go to update the theme, please do that in a staging environment first, once all is ready and ok, then you move to the live website. Also, the strings translations should continue working. If you find any issue related to this, feel free to contact us and we will help you as soon possible.

We hope this helps and clarifies!

Please try that and let us know if you need further assistance.

Kind Regards,

Rodrigo.

aThemes Support

Hi Rodrigo, thanks for your answer.
I have to apologize - already before I changed the name of the “Name” key in the XML file… but did not realize that I mistook a dash for an underscore … entirely my fault. Seems to work now as expected.
sorry for wasting your time!
Cheers, Timo

Hello Timo,

No worries! We are here to help!

Great the issue is now resolved.

If you need any further help feel free to contact us.

Kind Regards,

Rodrigo.

aThemes Support