Last update at :2024-01-27,Edit by888u
A few days ago, many people asked in the group about the solution to the problem of "&" being escaped into "&" in WordPress. This is actually a problem with the html escape character. For the time being, there is no solution except to modify WordPress, because this problem is caused by the source code of WordPress. However, with the help of Xiao Zhe Blog, we found that there is another This solution can successfully solve the problem of characters being escaped. The blogger has recorded another solution in this article, you can refer to it if necessary.
1. Add forbidden escape code
Open the function.php file under the theme and add the following code after the file:
// disable escape symbols add_filter( 'the_content', function( $string ) { return preg_replace_callback( '|]*)>(.*?)|', function( $matches ) { return '' . $matches[2] . ''; }, $string ); }, 10, 1 );Add the code and save it, then use ctrl+u to view the source code of the web page. You can see that the "&" in the article has not been escaped.
2. Others
This code applies to almost all wordpress versions!
Recommended site search: independent ip host, domain name valuation query, virtual space host, American space, domain name space agent, cheap domain name registration, pw domain name cheap domain name registration, Chinese domain name registration official website, domain name resolution server,
发表评论