Wordpress FORCE UPDATE of permalink settings

Posted by Scott B on Stack Overflow See other posts from Stack Overflow or by Scott B
Published on 2010-03-08T03:47:28Z Indexed on 2010/03/08 3:51 UTC
Read the original article Hit count: 319

Filed under:
|

I've been having issues on creating new wordpress blogs where I'm setting permalinks via script on theme activation. However, even though they appear to be correct when I check the permalink settings in WP, my new pages are throwing 404 errors.

The only fix I've found is that I have to go back to permalink options and click "Save Changes", even though, according to the display, I've made no changes to need to save...

I'm setting permalinks to /%postname%/

Here's how I'm doing it.

if(get_option('permalink_structure')==""){update_option('permalink_structure', '/%postname%/');}

That script gets run when my theme is activated.

Any ideas why it only partially does the job?

© Stack Overflow or respective owner

Related posts about Wordpress

Related posts about permalinks