Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1405208

    Hi team,

    I am currently creating a website for a sports club with a partner/logo element on the front page. They are thinking about increasing their annual fee if the links on the site should be “follow” instead of “nofollow”. I.e. it may be that some links should be “follow” and some “nofollow” in the same partner/logo element. How can I set each logo to follow or nofollow individually?

    Thx in advance!
    Markus

    #1405236

    Hey mrqslmk,
    Thanks for your question, I assume that you are not using any plugins like Yoast to set the nofollow on your links, in my test site the Partner/Logo Element doesn’t have the “rel” attribute set so I recommend this code to the end of your child theme functions.php file in Appearance ▸ Editor:

    function custom_script() { ?>
      <script>
    (function($){
    $('.avia-logo-grid .slide-entry').each(function() {
      $(this).find('a[href *="google.com"]').attr("rel", "nofollow");
      $(this).find('a[href *="kriesi.at"]').attr("rel", "follow");
     });
    })(jQuery);
    </script>
      <?php
    }
    add_action('wp_footer', 'custom_script');

    and adjust the links to suit and add as many as you like. This sets the nofollow or follow based on the link URL

    Best regards,
    Mike

    #1405238

    Hey Mike,

    thx for your response. I’m afraid this didn’t work on my end.

    I added the script you provided to the functions.php of my child theme, replaced your links with mine and then checked in the dev tools of the frontend if I can see a rel=”nofollow” or “follow”. In both cases, I only see “noopener noreferrer”.

    #1405246

    Hi,
    It sounds like you have a plugin adding noopener noreferrer try disabling your plugins and checking again.
    Otherwise please include an admin login in the Private Content area and link to the page so we can be of more assistance.

    Best regards,
    Mike

    #1405253

    Hi Mike,
    I’ve just deactivated all plugins, same issue. Please check credentials in the private content.

    Afterwards, I reactivated them. Please feel free to deactivate the plugins again while making your tests. I’d just like to ask you to reactivate them again afterwards.

    Thank you!

    • This reply was modified 1 year, 6 months ago by mrqslmk.
    #1405256

    Hi,
    Thanks for the login, I found that setting the links to open in a new tab adds this, so I adjusted the script to have a slight delay and this seems to have corrected. Please clear your browser cache and check.

    
    function custom_script() { ?>
      <script>
    (function($){
    	setTimeout(function () {
    $('.avia-logo-slider .slide-entry').each(function() {
      $(this).find('a[href *="link-one.de"]').attr("rel", "nofollow");
      $(this).find('a[href *="link-two.de"]').attr("rel", "follow");
      $(this).find('a[href *="link-three.de"]').attr("rel", "follow");
     });
    		}, 300);
    })(jQuery);
    </script>
      <?php
    }
    add_action('wp_footer', 'custom_script');

    Best regards,
    Mike

    #1405258

    That works perfectly. Thank you so much!

    #1405260

    Hi,
    Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Partner/Logo Element: No follow vs. follow links’ is closed to new replies.