Hello I have a static home page, then a blog page set to template “blog”
When I click on the blog page the url is site.com/blog
BUT when I click on the blog post it goes to http://www.site.com/blog_title!
How do we add blog into the URL of single pages? The client 100% requires it and I am at a lost and burning time fast, thanks in advance.
You need to change your Permalink structure.
ok so you are saying http://www.site.com/blog/%postname%
I did this and it works great but I had custom post type and taxonomies that it added blog/ in front of too so after research when registering a CPT or TAX for the rewrite(url) I did:
'rewrite' => array( 'slug' => 'custom_post_type_name/', 'with_front' => false),
Thanks for this! Is this how you would accomplish this or do you have a simpler approach?
As a side note I was worried changing the permalink structure would change general page url’s as well for example site.com/page and make it site.com/blog/page but this seems to only change posts and custom post types which is a good thing in my case.
So do you have this resolved now?
Yes all single posts appear with blog/ in front, then making sure all CPT’s and TAX’s are registered w/
'with_front' => false), so blog does not appear in the URL for these.
Seems to be working thanks I would say it is resolved.
The topic ‘Add blog to URL’ is closed to new replies.
Are you a blogger, web designer, developer, or website owner looking to generate more income?
Promote products for the largest and fastest growing online website platform as part of our affiliate program.