Need help.
I want to add rel="nofollow" tag to the pagination links that is shown in my website theme.
I am using this function to use pagination.
<?php
$paged1 = isset( $_GET['paged1'] ) ? (int) $_GET['paged1'] : 1;
$pag_args1 = array(
'format' => '?paged1=%#%',
'current' => $paged1,
'total' => $query1->max_num_pages,
'prev_text' => __('« Prev'),
'next_text' => __('Next »'),
'add_args' => array( 'paged2' => $paged2 )
);
echo paginate_links( $pag_args1 );
?>
Wordpress does not expose any filters for modifying or adding HTML attributes to
<a>
tags generated bypaginate_links
. Fortunately the links returned by the function are fairly simply and standard, so string substitution should do the trick: