WordPress adds links to the specified keywords in the content of the article

function replace_text_wps($text){
$replace = array(
'Theme King' => '<a href="https://yijile.com/tag/wordpress/" rel="tag" >Theme King</a>',
'WordPresstheme' => '<a href="https://wpfans.org/theme" rel="category tag" >WordPresstheme</a>',
'WrodPresscourse' => '<a href="https://wpfans.org/wplearn" rel="nofollow" target="_blank" >WrodPresscourse</a>'
$text = str_replace(array_keys($replace), $replace, $text);
return $text;

add_filter('the_content', 'replace_text_wps');

usage method

Paste the following code into your own WordPress theme functions.php File.

Related Article
Two methods of automatically renaming uploaded files in WordPress

When we edit and publish articles, we often upload some pictures, audio and other files. Interested webmasters will find that Read more

WordPress tutorial: adding author filtering options to the background article list

When there are multiple users publishing articles in our site, in order to facilitate the administrator to view the article Read more

WordPress displays the registration time of the login user in the frontend

When using WordPress to build a website, some users want to display the user registration time in the frontend, but Read more

WordPress adds the number of SQL queries at the bottom

An excellent woodpress theme is definitely that the less SQL consulting is used, the better. How can we see how Read more

Leave a Reply

Your email address will not be published. Required fields are marked *

To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-spam image