Please help add no follow tag in Image Widget code
-
Hi there,
I’m trying to add a rel=nofollow tag to Image Widget in /views/widget.php
On the following post, the author gives a solution:
https://erikshosting.com/wordpress-tips-code/add-nofollow-rel-tags-to-image-widget/The solution is in this extract:
<?php echo $before_widget; if ( !empty( $title ) ) { echo $before_title . $title . $after_title; } if ( !empty( $image ) ) { if ( $link ) { echo '<a rel="nofollow" class="'.$this->widget_options['classname'].'-image-link" href="'.$link.'" target="'.$linktarget.'">';
But the code has now changed since 3 years and I’d like one of you kind experts to tip me on where put the “a rel=”nofollow” in the new code that is different than in the previous version and is now:
<?php /** * Widget template. This template can be overriden using the "sp_template_image-widget_widget.php" filter. * See the readme.txt file for more info. */ // Block direct requests if ( !defined('ABSPATH') ) die('-1'); echo $before_widget; if ( !empty( $title ) ) { echo $before_title . $title . $after_title; } echo $this->get_image_html( $instance, true ); if ( !empty( $description ) ) { echo '<div class="'.$this->widget_options['classname'].'-description" >'; echo wpautop( $description ); echo "</div>"; } echo $after_widget; ?>
Many thanks in advance because this feature would help me a lot as I use Image Widget for Ads purpose.
Best regards,
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Please help add no follow tag in Image Widget code’ is closed to new replies.