Tagged: 

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1257925

    Hi, I would like to make my image link on the full width easy slider nofollow but I cannot work out how to do it. If it is easier, I am happy to make all external links nofollow. I tried a couple of plugins but they didn’t work. I tried editing the html in the default editor but it just corrupted the page.
    Thanks for your help.

    #1259046

    Hey aliciapotts,
    Sorry for the very late reply and thanks for the link to your site, I was not sure if you wanted to keep the current attributes noopener noreferrer and add nofollow , if not please feel free to adjust the code below to suit.
    I would recommend adding a custom ID to the slider so it will be easier if you want to use this on other pages, in the code below the ID is #full_slider_4 feel free to adjust the code to suit your custom ID.
    Try adding this code to the end of your functions.php file in Appearance > Editor:

    function custom_script(){
      ?>
      <script>
    (function($){
      $(document).ready(function(){
      $("#full_slider_4 a.avia-slide-wrap").attr("rel", "nofollow noopener noreferrer");
     });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_script');

    Then clear your browser cache and check.

    Best regards,
    Mike

    #1259049

    Hi,
    I just noticed that there are more than one of these on the page so instead of adding a custom ID, please add a custom class and change the ID to your class like this:

    function custom_script(){
      ?>
      <script>
    (function($){
      $(document).ready(function(){
      $(".custom_class a.avia-slide-wrap").attr("rel", "nofollow noopener noreferrer");
     });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_script');

    Best regards,
    Mike

    #1261706

    Hi Mike,

    Thank you for the advice. I added the custom class ‘christmaswarehouse’ to all the ad sliders. Then I put the code below in the functions.php but the links don’t seem to be nofollow. Would you please advise where I went wrong? Thank you.

    function custom_script(){
    ?>
    <script>
    (function($){
    $(document).ready(function(){
    $(“christmaswarehouse a.avia-slide-wrap”).attr(“rel”, “nofollow noopener noreferrer”);
    });
    })(jQuery);
    </script>
    <?php
    }
    add_action(‘wp_footer’, ‘custom_script’);

    #1261795

    Hi,
    In your code the custom class ‘christmaswarehouse’ doesn’t have the class identifier “dot”…
    So your current code is:
    $("christmaswarehouse a.avia-slide-wrap")
    but it should be like this:
    $(".christmaswarehouse a.avia-slide-wrap")
    Please give this a try and then clear your browser cache, and check.

    Best regards,
    Mike

    #1263175

    Thank you for pointing that out.

    My ‘screaming frog’ analysis still says the links are dofollow. But, when I inspect the image on the page it seems to be nofollow. What is the best way to know for sure if it has worked?

    #1263260

    Hi,
    I’m not sure what ‘screaming frog’ is, but this script works in the DOM, the actual HTML doesn’t contain the change, so is your analysis after the DOM or before?
    When I check it is working, please see the screenshot in Private Content area.

    Best regards,
    Mike

    #1264684

    Okay great. I think I have to trust you that it is working now. Thanks for your help.

    #1264686

    Hi,

    I’m glad this was resolved. If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Nofollow links on full width easy slider’ is closed to new replies.