Tagged: nofollow
-
AuthorPosts
-
June 16, 2016 at 2:27 pm #649230
Hi,
I have an affiliate review site: http://testogbedst.dk/bedste-loebesko-damer-2016/
I have manually added rel=”nofollow” to a link. Isn´t there a way to add it automatically?
Regards Peter
June 16, 2016 at 2:33 pm #649232Hey Petersjuul,
Please enable the custom css class field: http://kriesi.at/documentation/enfold/turn-on-custom-css-field-for-all-alb-elements/ and then edit your element and give it a custom class and then add following code to functions.php file in Appearance > Editor
function add_nofollow_attr(){ ?> <script> jQuery(window).load(function(){ jQuery('.your-custom-class a').attr('rel','nofollow'); }); </script> <?php } add_action('wp_footer', 'add_nofollow_attr');
Best regards,
YigitJune 17, 2016 at 6:22 pm #649924I have this same need, and when I implemented Yigit’s solution, it added rel=”nofollow” to the outer <div>… not the HREF tag, as needed.
How can we add “nofollow” to the HREF tag itself?
June 17, 2016 at 9:43 pm #650001Hey!
can you please create a new ticket ticket and provide us a link of your web site, so we can give it a look?
Thank youBest regards,
BasilisJune 18, 2016 at 3:29 am #650060I have already. Still awaiting a reply :D’
June 20, 2016 at 7:27 pm #651037Hi,
We replied you here – https://kriesi.at/support/topic/need-to-add-relnofollow-to-all-my-outbound-promo-boxes-links-etc/#post-650559 :)
Best regards,
YigitJuly 1, 2016 at 9:23 pm #655917Hi Yigit,
It works perfect – And also on my MTB blog :-)
But when I add other links than affiliate links, I would like that they are followed(do follow)
Is there a way to accomplish this or should I make new elements for these?
Regards Peter
July 4, 2016 at 2:15 pm #656575August 15, 2018 at 5:32 pm #997621Hi Enfold helpers,
If we want to let all links in footers and body to get nofollow, How can we change this line?
jQuery(‘.your-custom-class a’).attr(‘rel’,’nofollow’);I am very bad in code and really need your help on exact code.
Thanks,
HoangAugust 15, 2018 at 9:47 pm #997689Hi,
You can use
jQuery(‘body’).attr(‘rel’,’nofollow’);
And it should fix the issues for you with no problem
Best regards,
BasilisAugust 16, 2018 at 5:59 pm #998040Thanks Basilis,
I have added the code with the process of the custom css class field, but the body and footer links still do not turn into nofollow. I also need to add the nofollow for button and the total code is like thisfunction add_nofollow_attr(){
?>
<script>
jQuery(window).load(function(){
jQuery(‘body’).attr(‘rel’,’nofollow’);
});
</script>
<?php
}
add_action(‘wp_footer’, ‘add_nofollow_attr’);
// custom script
add_action(‘wp_footer’, ‘ava_custom_script’);
function ava_custom_script(){
?>
<script>
(function($) {
function a() {
$(‘.av_promobox’).each(function() {
$(this).find(‘.avia-button-wrap a’).attr(‘rel’, ‘nofollow’);
});
}a();
})(jQuery);
</script>
<?php
}Is that bad?
The second part is just a copy from here
My web is https://mekongtrails.com
Thanks,
Hoang- This reply was modified 6 years, 3 months ago by Hoang Truong.
August 17, 2018 at 1:25 pm #998425Hi,
The code won’t work if you add it to the quick css field because it’s no css code. Add this code to the child theme functions.php instead (Appearance > Editor > Enfold (or Enfold child) and select “functions.php”):
function avia_custom_head_javascript() { ?> <script> jQuery(document).ready(function() { jQuery('body > a').attr('rel','nofollow'); }); </script> <?php } add_action('wp_footer', 'avia_custom_head_javascript');
Best regards,
Dude -
AuthorPosts
- You must be logged in to reply to this topic.