• My theme’s custom options panel has the following code…

    /*
    initialize the site options
    */
    if(get_option('permalink_structure')==""){update_option('permalink_structure', '/%postname%/');}

    This checks the permalink option setting and since the default is “” or site.com/?p=x, then if the user has not changed from the default, my script does it for them, by setting permalink to post name.

    However, I’ve had a few folks who have my template tell me that upon first install, they were getting 404 errors on pages.

    Apparently, the workaround is to physically navigate to the Permalinks page and just click “Save Changes” (even though when you first hit this page, the Permalink comes up as if it’s correctly entered into the “custom” field.

    Anyone know why this happens? Is their perhaps another setting in the db that determines the permalink in addition to what happens when update_options() is called as in the above code?

  • The topic ‘Setting Permalinks using update_option() > Bug in wp?’ is closed to new replies.