-
AuthorPosts
-
June 24, 2014 at 10:28 pm #283281
Hello,
I’ve already opened this topic (https://kriesi.at/support/topic/add-relnofollow-on-button-links/) but it’s closed and I can’t add an answear.
After applying the method of Yigit, I’m not satisfied of the result.Indeed, my code looks like that :
<div class=’avia-button-wrap avia-button-left avia-builder-el-2 el_after_av_one_third el_before_av_hr rel-nofollow’>
<span class=’avia_button_icon’ aria-hidden=’true’ data-av_icon=’’ data-av_iconfont=’entypo-fontello’></span>
<span class=’avia_iconbox_title’ >My anchor text</span>
</div>As you can see, there isn’t the rel=”nofollow” on the . The function added doesn’t works.
Can you help me again ?June 24, 2014 at 10:30 pm #283282Hey JBMKL!
Can you post the link to your website and point out the buttons? Code i posted should add rel=”nofollow” to A tagged elements with .rel-nofollow class
Cheers!
YigitJune 24, 2014 at 11:58 pm #283320You can find an example here : http://www.foot-actu.com/billets-football-europe/places-billets-ligue-1-france/paris-st-germain-fc/psg-bastia-samedi-16-aout-2014/
The link is the button with the anchor texte Acheter billet PSG BastiaThe div has the classe “rel-nofollow” but it doesn’t add the attribute ont the < a >
June 25, 2014 at 4:18 am #283389Hey!
Thank you for the update.
I checked the page and the button does have a rel=”nofollow” attribute applied to it. This is the button code:
<div class="avia-button-wrap avia-button-left avia-builder-el-2 el_after_av_one_third el_before_av_hr rel-nofollow"> <a href="http://www.viagogo.fr/psg/Billets-de-sport/Football/Ligue-1/Paris-Saint-Germain-Billets/E-667348?AffiliateID=1277&PCID=AFFFRIAFF1277REFART0F4EDEAE1E-10" class="avia-button avia-icon_select-yes avia-color-theme-color avia-size-small avia-position-left" target="_blank" rel="nofollow"><span class="avia_button_icon" aria-hidden="true" data-av_icon="" data-av_iconfont="entypo-fontello"></span><span class="avia_iconbox_title">Acheter billet PSG Bastia</span></a> </div>
Regards,
IsmaelJune 25, 2014 at 8:46 am #283444Yes, this is when you use sthg like Webdevelopper to check the code where the code is already interpreted.
Look at the source, you’ll not see the same thing. And you’ll not see a rel=”nofollow” on the < a >. So does Google.
The adding of the attribute is conditionned to a javascript that Google won’t see. And as you probably know, rel=”nofollow” is mainly here for Google.June 25, 2014 at 10:18 am #283470Hey!
Please go to Enfold/config-templatebuilder/Avia-shortcodes folder and open Buttons.php file and find
$output .= "<a href='{$link}' class='avia-button ".$this->class_by_arguments('icon_select, color, size, position' , $atts, true)."' {$blank} {$style} >";
and change it to
$output .= "<a rel='nofollow' href='{$link}' class='avia-button ".$this->class_by_arguments('icon_select, color, size, position' , $atts, true)."' {$blank} {$style} >";
Cheers!
YigitJune 25, 2014 at 1:24 pm #283577Hello,
It’s ok like this.
The matter is that I’ll have this attribute on all buttons of my website, isnt’it ?On the Buttons.php file, can you explain me what these lines means and what is this rel=”nofollow” mentionned ?
$blank = strpos($atts[‘link_target’], ‘_blank’) !== false ? ‘ target=”_blank” ‘ : “”;
$blank .= strpos($atts[‘link_target’], ‘nofollow’) !== false ? ‘ rel=”nofollow” ‘ : “”;I’ve tried to put link_target=’nofollow’ in my code and it’s ok (without target blank)
If you think it’s ok too, can I delete codes I added in my function.php with the js and the custom class ?
- This reply was modified 10 years, 4 months ago by JBMKL.
June 25, 2014 at 2:02 pm #283591Hey!
It seems ok. If it does what you would like to achieve, you can remove js code and custom class :)
Best regards,
YigitJune 25, 2014 at 2:06 pm #283596Ok, thank you for your help
June 25, 2014 at 2:07 pm #283598 -
AuthorPosts
- The topic ‘Add rel="nofollow" on button links #2’ is closed to new replies.