当前位置:网站首页>A solution to the problem that the separator of WordPress title - is escaped as -

A solution to the problem that the separator of WordPress title - is escaped as -

2022-06-24 17:26:00 Ashi

Recently, many users have given me feedback that they are using WordPress When the subject is , stay SEO The separator in the setting is customized to English special character horizontal bar "-" after , Will be taken as HTML character &#8211

The reason is that it's all WordPress Too thoughtful pot , By default , It will call the function wptexturize To perform this transformation .

terms of settlement 1: Stop using wptexturize Escape any character

add_filter( 'run_wptexturize', '__return_false' );

terms of settlement 2: call remove_filter Function to remove the wptexturize Call to

remove_filter('the_title', 'wptexturize');

The above solutions , Choose one , that will do . Insert code into functions.php At the bottom of the file .

If you use nicetheme The theme , Please insert the code into the topic Directory functions_xxxx.php In file .ps:xxx For the title of the subject , such as   pandapro The theme , namely functions_pandapro.php file .

Here's the picture :

原网站

版权声明
本文为[Ashi]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202211516361722.html