How to add a target to a link

If you use the filter “the_content” you can use a combination of preg_… statements to loop through all links, adding target=”_blank” to those matching your specific requirements. You can add this filter to your functions.php, or to select page,post, or category templates . add_filter( ‘the_content’, ‘ex1_the_content_filter’ ); function ex1_the_content_filter($content) { // finds all links in … Read more

How to change the canonical link from a category or taxonomy archive?

I found the solution by myself: function yoast_seo_canonical_change_archives( $canonical ) { if ( is_tax( ‘tourist-spots’ ) ) { $path = parse_url( $canonical, PHP_URL_PATH ); return ‘https://www.luxuryvillasphuketthailand.com’ . $path; } return $canonical; } add_filter( ‘wpseo_canonical’, ‘yoast_seo_canonical_change_archives’, 10, 1 );

How to add a column into the link manager?

Normally, default post and custom post type screen could use the following manage_{$screen->id}_columns – for custom column header manage_posts_custom_column – for custom column data for non-hierarchical post types OR manage_{$post->post_type}_posts_custom_column – any custom post-types However, links is not a post type and the data is in its own database table, different to post table. While … Read more