Link to home
Start Free TrialLog in
Avatar of Nathan Riley
Nathan RileyFlag for United States of America

asked on

Worpdress Post Not Saving

I have a Wordpress post that when trying to save it just redirects to the 404 not found page.  

If I only have text in the post it works just fine, but when trying to show a code example of:
    $postTitle = str_replace(
        array("\xe2\x80\x98", "\xe2\x80\x99", "\xe2\x80\x9c", "\xe2\x80\x9d", "\xe2\x80\x93", "\xe2\x80\x94", "\xe2\x80\xa6"),
        array("'", "'", '"', '"', '-', '--', '...'),
        $postTitle);
    $postTitle = str_replace(
        array(chr(145), chr(146), chr(147), chr(148), chr(150), chr(151), chr(133)),
        array("'", "'", '"', '"', '-', '--', '...'),
        $postTitle);

Open in new window


In the post and saving it redirects to the 404 page, not sure why or what in this is causing the issue?
Avatar of David Favor
David Favor
Flag of United States of America image

Why this might happen is highly depending on your WordPress stack - theme + plugins.

Likely your theme won't change post/page slugs.

Plugins, especially SEO plugins, can muck about with slugs.

You say "show a code example" + it's unclear why you'd change your title, if you were just trying to embed a code example in your content.

Also... you don't mention how you're getting the shown str_replace(...) calls to fire... hook? plugin? hacked theme functions.php?

Try starting at the beginning + describe exactly what you're trying to accomplish + how you're firing your code.
Avatar of Nathan Riley

ASKER

What I mean by show a code example is just that, I'm not trying to execute code on the page, I'm just dropping it in with <code> tags so that it can be shown in the article.
ASKER CERTIFIED SOLUTION
Avatar of Nathan Riley
Nathan Riley
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Figured out on my own.