Support » Plugin: Slider by Soliloquy - Responsive Image Slider for WordPress » How set image link as rel="nofollow"

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Thomas Griffin

    (@griffinjt)

    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 . '>';
    
    }

    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

    Plugin Author Thomas Griffin

    (@griffinjt)

    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 . '>';
    
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How set image link as rel="nofollow"’ is closed to new replies.