WordPress.org

Ready to get started?Download WordPress

Forums

WP changes X to multiplication symbol! (9 posts)

  1. Craw4x4PH
    Member
    Posted 6 years ago #

    My domain is 4x4ph.com (4x4 Philippines) and WordPress automatically changes the 'x' to the multiplication symbol:
    ×

    Everything was OK at first but now that I need to redirect some of my pages to some of my subdomains (videos.4x4ph.com) the redirect won't work because WP reads the domain as 4×4.com

    How can I fix this? I'm using EasyRedirect by http://www.ejump.co.uk/

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    Huh. That one rarely comes up.

    Edit wp-includes/formatting.php.

    In the wptexturize function, at about line 23, you'll find these two lines:

    $dynamic_characters = array('/\'(\d\d(?:’|\')?s)/', '/(\s|\A|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A)"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/(\d+)x(\d+)/');
    $dynamic_replacements = array('’$1','$1‘', '$1″', '$1′', '$1’$2', '$1“$2', '”$1', '’$1', '$1×$2');

    The very last section in each one is what is doing the replacing you are describing. Change them to these to eliminate that:

    $dynamic_characters = array('/\'(\d\d(?:’|\')?s)/', '/(\s|\A|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A)"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/');
    $dynamic_replacements = array('’$1','$1‘', '$1″', '$1′', '$1’$2', '$1“$2', '”$1', '’$1');

    All I did was to remove the last entry in each array. Remove those and you're good.

  3. Craw4x4PH
    Member
    Posted 6 years ago #

    Hi Otto,

    I did what you said. I copy-pasted the code you posted but I'm still having the same problem. I have already cleared my cache but the problem still persists.

    EDIT -- Correction: the problem became bigger. I'm now getting a Parse Error:

    Parse error: syntax error, unexpected T_LNUMBER in /*/*/*/*/wp-includes/formatting.php on line 98

    (replaced path with *) So I reverted back to the original. Then I also tried just replacing the offending characted with the regular x and I still get the same Parse Error message, same line (98).

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    I copy-pasted the code you posted

    Well, don't do that. Edit the code yourself, like I explained in the text above.

    Copy and pasting code is not guaranteed to work in this case. This is because of the amp characters.

    Just edit those lines in a normal text editor (Notepad will work) and remove the bits I mentioned.

    Specifically, remove:
    , '/(\d+)x(\d+)/'

    and
    , '$1& #215;$2'

  5. Craw4x4PH
    Member
    Posted 6 years ago #

    OK, I edited the code by hand. I made sure I only deleted the code BEFORE the ) until the last , but I still get the same Parse Error when I try to go to other pages.

    But there's no error when I view the posts.

    EDIT -- yes, that's what I removed, exactly those characters.

  6. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    I still get the same Parse Error

    Well, you're not editing anything anywhere near line 98, so that doesn't make any sense.

    Start with a fresh unedited copy of the file. Download the WordPress.zip again if you have to.

    Use a very basic text editor. Notepad. TextPad. Not Word or anything else. Other editors can do things that basic simple text editors do not.

    Other than that, I don't know what to tell you. The instructions I gave work. I tested it just now.

  7. Craw4x4PH
    Member
    Posted 6 years ago #

    Thanks, Otto.

    I'll try again. I used Dreamweaver in code view to do the edits.

    When I open it in Notepad it isn't "formatted" correctly. I'll try to download a simple text editor and use that then I'll update this thread.

  8. Craw4x4PH
    Member
    Posted 6 years ago #

    Weird. It's still giving me the same problem and error...

    As stated in the first post one of the main problems I'm encountering with this replacing of characters is my redirection plugin. Since the code replaces the small X I tried using the capital X for the plugin tag. Good thing domain names are case-insensitive so it worked, but seeing the times symbol in my domain within my posts and/or pages is irritating.

    It could also confuse new-comers to the site...

    *sigh*

  9. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    I edited this file perfectly in Notepad, so I don't understand what you mean by "not formatted correctly".

    The solution is very simple and I've done it myself to prove that it works. I don't know what kind of problems you're having or why you're getting that error, but I really can't make it any simpler.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.