WordPress.org

Ready to get started?Download WordPress

Forums

Responsive WordPress Slider - Soliloquy Lite
[resolved] How set image link as rel="nofollow" (4 posts)

  1. wpstefan
    Member
    Posted 1 year ago #

    Hi,
    Great plugin! We need to add the rel="nofollow" attribute to the image link. How can that be done?

    Best regards,
    Stefan

    http://wordpress.org/extend/plugins/soliloquy-lite/

  2. Thomas Griffin
    Member
    Plugin Author

    Posted 1 year ago #

    This should do it for you. Add this to your theme's functions.php file:

    add_filter( 'tgmsp_image_output', 'tgm_soliloquy_link_nofollow', 10, 5 );
    function tgm_soliloquy_link_nofollow( $html, $id, $image, $link_title, $link_target ) {
    
    	return '<a href="' . esc_url( $image['link'] ) . '" title="' . esc_attr( $link_title ) . '" rel="nofollow" ' . $link_target . '>';
    
    }
  3. wpstefan
    Member
    Posted 1 year ago #

    Hi Thomas,

    Thanks for your reply. However, the code caused the slider not to load at all. I assume something is wrong in the code you gave me...?

    Best regards,
    Stefan

  4. Thomas Griffin
    Member
    Plugin Author

    Posted 1 year ago #

    Sorry - accidentally typed wrong filter name. This will work:

    add_filter( 'tgmsp_link_output', 'tgm_soliloquy_link_nofollow', 10, 5 );
    function tgm_soliloquy_link_nofollow( $html, $id, $image, $link_title, $link_target ) {
    
    	return '<a href="' . esc_url( $image['link'] ) . '" title="' . esc_attr( $link_title ) . '" rel="nofollow" ' . $link_target . '>';
    
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic