• Resolved tareqismailgmailcom

    (@tareqismailgmailcom)


    Hello all!

    I want to add code to my theme so that when it installs it enables permalinks.
    Any ideas how or if this is possible?

    Thanks!

Viewing 1 replies (of 1 total)
  • There is an ‘option_name’ in $wpdb->options called ‘permalink_structure’ that installs with an empty value. If you change the permalink structure it then stores a string similar to this: ‘/%year%/%monthnum%/%day%/%postname%/’ I suspect that that is the trigger but I haven’t tested it. There are almost certainly some built in functions to manipulate that option but I don’t have the time to dig for them.

    Pretty permalinks only work on some server configurations. You could cause users some headaches by enabling this automatically, and if you count on permalinks your theme will only work on some servers. This doesn’t seem like a very good idea to me, respectfully.

Viewing 1 replies (of 1 total)
  • The topic ‘Enable permalinks from theme?’ is closed to new replies.