WPML Header URL Not Correct - by KlaasKoopman

This topic has 10 replies, 2 voices, and was last updated 8 years, 10 months ago ago by Jack Richardson

  • Avatar: KlaasKoopman
    KlaasKoopman
    Participant
    February 11, 2016 at 21:03

    Hi there,

    Currently Google is indexing my website under url.com/nl and url.com/nl/ because the code of the logo is not WPML compliant, see : https://wpml.org/wpml-hook/wpml_home_url/

    I looked at the theme and found this in theme-functions.php:

     <?php if($logoimg): ?>
                <a href="<?php echo home_url(); ?>"><img src="<?php echo $logoimg ?>" alt="<?php bloginfo( 'description' ); ?>" /></a>
            <?php else: ?>
                <a href="<?php echo home_url(); ?>"><img src="<?php echo PARENT_URL.'/images/logo.png'; ?>" alt="<?php bloginfo('name'); ?>"></a>
            <?php endif ; 
            do_action('etheme_after_logo');
        }

    I have no idea how to fix this, please help me out!

    9 Answers
    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    February 12, 2016 at 13:43

    Hello,

    Please provide us with WP dashboard and FTP (FTP host, FTP user, FTP password) credentials in private content.

    Best regards,
    Jack Richardson.

    Avatar: KlaasKoopman
    KlaasKoopman
    Participant
    February 12, 2016 at 14:05

    Hi Jack,

    Thank you for replying. You can find the info below:

    Please, contact administrator
    for this information.
    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    February 12, 2016 at 15:45

    Hello,

    As you can see in the WPML documentation you provided https://wpml.org/wpml-hook/wpml_home_url/

    * Note: Good code will make use of get_home_url() or home_url() which apply filters natively. In this case there is no need to replace anything.

    And there is in the part of code from theme-functions.php home_url() function is used.

    Best regards,
    Jack Richardson.

    Avatar: KlaasKoopman
    KlaasKoopman
    Participant
    February 12, 2016 at 16:35

    But somehow the link to the logo is not correct and thus linking it to /language instead of /language/

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    February 15, 2016 at 10:15

    Hello,

    Then try to change the following lines of code you provided in your first post

       <a href="<?php echo home_url(); ?>"><img src="<?php echo $logoimg ?>" alt="<?php bloginfo( 'description' ); ?>" /></a>
            <?php else: ?>
                <a href="<?php echo home_url(); ?>"><img src="<?php echo PARENT_URL.'/images/logo.png'; ?>" alt="<?php bloginfo('name'); ?>"></a>

    to

       <a href="<?php echo home_url('/'); ?>"><img src="<?php echo $logoimg ?>" alt="<?php bloginfo( 'description' ); ?>" /></a>
            <?php else: ?>
                <a href="<?php echo home_url('/'); ?>"><img src="<?php echo PARENT_URL.'/images/logo.png'; ?>" alt="<?php bloginfo('name'); ?>"></a>

    Best regards,
    Jack Richardson.

    Avatar: KlaasKoopman
    KlaasKoopman
    Participant
    February 15, 2016 at 11:17

    Hi Jack,

    That didn’t solve the issue, still links to site.com/nl instead of site.com/nl/

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    February 15, 2016 at 11:49

    Hello,

    I’ve pasted needed part of code with changes to the wp-content/themes/royal-child/functions.php file.
    Please clear browser cache and check the site.

    Best regards,
    Jack Richardson.

    Avatar: KlaasKoopman
    KlaasKoopman
    Participant
    February 15, 2016 at 16:16

    Great Jack, thank you!

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    February 15, 2016 at 16:21

    Hello,

    You’re welcome.
    We’d be thankful if you leave a comment on ThemeForest site http://themeforest.net/item/royal-multipurpose-wordpress-theme/8611976/comments .

    Thank you.
    Best regards,
    Jack Richardson.

  • Viewing 10 results - 1 through 10 (of 10 total)

The issue related to '‘WPML Header URL Not Correct’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.