How can I modify all existing tags while keeping the urls themselves?

I solved the issue with help from this answer: https://wordpress.stackexchange.com/a/159570/176615 // add nofollow to Amazon function add_nofollow_content($content) { $content = preg_replace_callback( ‘/<a[^>]*href=[“|\’]([^”|\’]*)[“|\’][^>]*>([^<]*)<\/a>/i’, function($m) { if (strpos($m[1], “amzn.to”) !== false) return ‘<a href=”‘.$m[1].'” rel=”nofollow noopener” target=”_blank”>’.$m[2].'</a>’; else return ‘<a href=”‘.$m[1].'” rel=”noopener” target=”_blank”>’.$m[2].'</a>’; }, $content); return $content; } add_filter(‘the_content’, ‘add_nofollow_content’);

Class active for Archive link – looped out

One way to do this is to get the current object ID with get_queried_object_id() and compare it against the category term ID inside the foreach loop. E.g. $current_object_id = get_queried_object_id(); foreach (get_categories() as $category) { $classes=””; if ( $category->term_id === $current_object_id ) { $classes .= ‘selected’; } printf( ‘<a class=”%s” href=”%s”>%s</a>’, $classes, get_category_link($category->term_id), $category->name ); … Read more

Add additional first page, last page links to the_posts_pagination()

the_posts_pagination() is an echo wrapper for get_the_posts_pagination(). The getter generates pagination links with paginate_links(), which returns a string with the links separated by a newline character by default. This string is passed to _navigation_markup() to get the complete pagination markup. We can manipulate the paginate_links() output with paginate_links_output filter, before the navigation markup is generated. … Read more