admin管理员组

文章数量:1290978

In titles of custom posts the single and double quotes are displaying as HTML - eg: the string starting with & and ending with ; - in the front end, although in the backend they are just typed as regular straight ' and ".

Not sure what is causing this. Is there any way to fix it?

Sorry if I have used the wrong terminology - not familiar with this problem.

Thanks.

In titles of custom posts the single and double quotes are displaying as HTML - eg: the string starting with & and ending with ; - in the front end, although in the backend they are just typed as regular straight ' and ".

Not sure what is causing this. Is there any way to fix it?

Sorry if I have used the wrong terminology - not familiar with this problem.

Thanks.

Share Improve this question asked Jun 16, 2021 at 11:27 KitkaKitka 1 3
  • Try to remove wpuntexturize filter by putting this code in your functions.php - remove_filter( 'the_title' , 'wptexturize' ); – anton Commented Jun 16, 2021 at 13:27
  • Yes, that fixed it! Thanks Anton. – Kitka Commented Jun 17, 2021 at 0:21
  • Glad it helped you. I will add it as an answer. – anton Commented Jun 17, 2021 at 5:23
Add a comment  | 

1 Answer 1

Reset to default 0

I think your problem related to wptexturize() function.

Description
Returns given text with transformations of quotes into smart quotes, apostrophes, dashes, ellipses, the trademark symbol, and the multiplication symbol.

Solution:

remove_filter( 'the_title' , 'wptexturize'  );

本文标签: custom post typessingle and double quotes are displaying as HTMLeg amp8217 and amp8220