I’m setting up a WordPress Network and wanted all new sites to have the same permalink structure (i.e. “/%year%/%monthnum%/%postname%/”). I’m wondering if this is possible to do via hooks or hacks in functions.php, without having to rely on users to choose that structure.
Leave a Reply
You must be logged in to post a comment.
You can set the permalink structure by calling on the
set_permalink_structure()
method of the global$wp_rewrite
object.Here’s a PHP < 5.3 version of the code in case you’re getting errors.
Previous Answer is not working. I have gotten a pure solution. Can use
Use this code. It will work 100%. Thanks