• Resolved rafax

    (@rafax)


    Hello, I would like to know how I can do so that all the personalized links of certain galleries (not all) can be nofollow.
    I have used the code that is in the documentation but it is for all the galleries, I just want it to be applied in some.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author bradvin

    (@bradvin)

    Hi @rafax,

    You can try this code. Please note that I have not tested it.

    
    function foogallery_nofollow_links($attr, $args, $foogallery_attachment) {
      	global $current_foogallery;
      	$galleries = array( 123, 124, 125 ); //set the gallery ID's here
      	if ( $current_foogallery && in_array( $current_foogallery->ID, $galleries ) ) { 
      	  	if ( 'custom' === $args['link'] && !empty($foogallery_attachment->custom_url) ) {
    	    	$attr['rel'] = 'nofollow';
    	  	}
      	}
    	return $attr;
    }
    

    You will have to change the $galleries array to include the ID’s of the galleries you want to change

    Thread Starter rafax

    (@rafax)

    Thanks, this was the solution, a greeting

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘nofollow links’ is closed to new replies.