We can give custom structure for our posts.

Go to [Settings -> Permalinks]

customi

In the custom structure, You can specify the structure u want to follow.

My default structure was – http://www.mywebsite.com/%year%/%month%/%day%/%psotname% and i  want my posts to be in a customized manner, prefixing /blog/. Now customized post structure looks like – http://www.mywebsite.com/blog/%year%/%month%/%day%/%psotname%.

If you are using any custom content types for posts, then the there is a chance  of permalinks getting broken as this customized structure affects to all posts type, so to handle this scenario, we need to add this piece of code to the register_post_type method,

'rewrite' => array('slug' => 'custom-post-name', 'with_front' => FALSE)

Not yet completed, we then need to got to [Settings -> Permalinks] and click on save, then only the change will reflect. 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Tag Cloud

%d bloggers like this: