- This topic has 4 replies, 1 voice, and was last updated 3 years, 6 months ago by
Javier.
-
AuthorPosts
-
July 20, 2019 at 2:04 pm #962962
Vish
Hi Tom
I was trying to create a post today and came across a very strange issue.
I tried to give the title for the post as ‘1080×2340 Wallpapers’. Whenever I do that, WordPress automatically treats the lowercase ‘x’ as multiplication symbol ‘×’ in the front end (when the post is published). If you look at them side by side (x×) they are not the same.
Because of this, the title of the post becomes ‘1080×2340 Wallpapers’ (this title has the multiplication symbol) as opposed to ‘1080x2340 Wallpapers’.
Is there some way we can override this with some PHP code?
For example, whenever a multiplication symbol ‘×’ comes in the title replace it with lower case ‘x’ with PHP?
Is it possible?
Note: I know this is nothing related to GP but I just wanted to see if it is possible to write a simple PHP function to achieve this.
July 20, 2019 at 7:53 pm #963075Tom
Lead DeveloperLead DeveloperHi there,
I wasn’t aware that WordPress did this by default. I just did some digging around for a function, but couldn’t find one.
It might be worth asking over here: https://wordpress.stackexchange.com/
April 18, 2020 at 4:48 pm #1244780Tom
No question, just a solution.
I had essentially the same question: how to disable the default WordPress behavior of replacing “5-25×56” with “5-25×56” (using multiplication symbol)? For more information about what wptexturize does, see: https://developer.wordpress.org/reference/functions/wptexturize/
Here’s the solution that I used to entirely disable wptexturize:
* Install the Code Snippets plug-in (see: https://docs.generatepress.com/article/adding-php/). This approach was simpler for me than creating a child theme just to run a single line of PHP.
* Add a snippet with the following line of code (see: https://codex.wordpress.org/Plugin_API/Filter_Reference/run_wptexturize):
add_filter( 'run_wptexturize', '__return_false' );April 19, 2020 at 9:18 am #1245556Tom
Lead DeveloperLead DeveloperThanks for posting your solution! 🙂
September 28, 2022 at 2:34 am #2356159Javier
Hi, this solution seems to work for the Spanish quotes too.
But it isn’t working with a Page hero block element.
I added a Header with “Dynamic text type” set to “Title” and it still shows the title with Spanish quotes (« ») instead the normal (” ”).
Does anyone have a solution for this issue?
-
AuthorPosts
- You must be logged in to reply to this topic.