• Resolved dragoev10

    (@dragoev10)


    Hello,

    First I want to congratulate you for the great plugin you have created!
    I want to ask you is there an option slides I create with links to be no follow or they are default no follow?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter dragoev10

    (@dragoev10)

    I’ll just add something to what I wrote. If I add in shortcode [sliderpro id=”5″ rel=”nofollow”] do you think that all the links inside this shortcode will be nofollow?

    Plugin Author bqworks

    (@bqworks)

    Hi,

    By default the rel=”nofollow” attribute is not added. In order to use it, you need to make use of the plugin’s API, more specifically filter hooks. These allow you to extend the functionality of the plugin. For example, to add the rel=”nofollow” attribute, you can add the following code in your theme’s functions.php:

    add_filter( 'sliderpro_slide_markup', 'slider_slide_markup', 10, 3 );
    
    function slider_slide_markup( $html_markup, $slider_id, $slide_index ) {
        $html_markup = str_replace('<a ', '<a rel="nofollow"', $html_markup);
    
        return $html_markup;
    }

    Best,
    David

    Plugin Author bqworks

    (@bqworks)

    Small correction to the code above (adding a space after the rel=”nofollow” attribute):

    add_filter( 'sliderpro_slide_markup', 'slider_slide_markup', 10, 3 );
    
    function slider_slide_markup( $html_markup, $slider_id, $slide_index ) {
        $html_markup = str_replace('<a ', '<a rel="nofollow" ', $html_markup);
    
        return $html_markup;
    }
    Thread Starter dragoev10

    (@dragoev10)

    The script works great! Thank you!

    Plugin Author bqworks

    (@bqworks)

    You’re welcome!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Question about plugin’ is closed to new replies.