-
AuthorPosts
-
December 16, 2019 at 10:20 pm #1166592
Hi Enfold button, please, could you remember me the right place to modify helper social media.php to set noindex of social button?
Thanks in advanceDecember 17, 2019 at 7:03 am #1166720Hey nuncer,
I’m not sure I understand you question, do you mean that you want to set the links to nofollow maybe?
Best regards,
RikardDecember 17, 2019 at 12:29 pm #1166791Hi Rikard, excuse me for mistake, I means nofollow…
December 17, 2019 at 7:53 pm #1166983Hi,
Yes, open up wp-content/themes/enfold/includes/helper-social-media.php and replace:
$this->html .= "<a {$blank} href='".$share['url']."' ".av_icon_string($icon)." title='' data-avia-related-tooltip='{$name}'><span class='avia_hidden_link_text'>{$name}</span></a>";
with this:
$this->html .= "<a {$blank} rel='nofollow' href='".$share['url']."' ".av_icon_string($icon)." title='' data-avia-related-tooltip='{$name}'><span class='avia_hidden_link_text'>{$name}</span></a>";
Best regards,
Jordan ShannonDecember 17, 2019 at 9:45 pm #1167027Hi Jordan, thanks for your answer. My question is about social icon on the home page and “Share this post” icons. I created a folder named “Includes” in enfold-child; I copied file “helper-social-media.php” in and inserted rel nofollow (it’s quite different from your description):
““;
$this->html .= “<span class=’avia_hidden_link_text’>{$name}</span>”; $this->html .= ‘‘;Modified in:
““; $this->html .= “<span class=’avia_hidden_link_text’>{$name}</span>”; $this->html .= ‘‘;but doesn’t work, I see now “noopener noreferrer” on the social icon on the home with inspector and nothing on the “share this post” icons. Is possible to have “noopener nofollow”?
Thanks again.December 20, 2019 at 1:22 pm #1168112Any advice?
Thank you.December 20, 2019 at 10:59 pm #1168344Hi,
Sorry for the late reply, to addrel='nofollow'
to the social icons at the top of your page you will need to edit line 167 of\enfold\includes\helper-social-media.php
look for:$html .= "<a {$blank} {$aria_label} href='" . esc_url( $icon['social_icon_link'] ) . "' " . av_icon_string( $icon['social_icon'] ) . " title='{$display_name}'>";
change to:
$html .= "<a {$blank} rel='nofollow' {$aria_label} href='" . esc_url( $icon['social_icon_link'] ) . "' " . av_icon_string( $icon['social_icon'] ) . " title='{$display_name}'>";
To add the
rel='nofollow'
to the “Share this entry” at the bottom of your post edit line 436, look for:$this->html .= "<a {$blank} {$aria_label} href='" . esc_url( $share['url'] ) . "' " . av_icon_string( $icon ) . " title='' data-avia-related-tooltip='{$name}'>";
change to:
$this->html .= "<a {$blank} rel='nofollow' {$aria_label} href='" . esc_url( $share['url'] ) . "' " . av_icon_string( $icon ) . " title='' data-avia-related-tooltip='{$name}'>";
But you can’t override a helper function inside a child theme. The override will only work for template files such as the header.php, loops, templates etc. So please make these changes to the parent theme.
Please save a copy of your original file as a fallback.Best regards,
MikeDecember 21, 2019 at 8:39 pm #1168510Hi Mike, it works. Great!
Thank you very much.
Best regards.December 21, 2019 at 9:55 pm #1168519Hi nuncer,
Glad we could help :)
If you need further assistance please let us know.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.