Add blog to URL

Community Forums Forums General Discussion Add blog to URL

This topic is: resolved

Tagged: 

This topic contains 5 replies, has 2 voices, and was last updated by  devongroup 6 months, 4 weeks ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #91407

    devongroup
    Participant
    Post count: 18

    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.

    #91414

    Anita
    Blocked
    Post count: 7712

    You need to change your Permalink structure.

    #91442

    devongroup
    Participant
    Post count: 18

    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),

    and it takes out blog bc/ it goes back to http://www.site.com/ for example http://www.site.com/promotions/

    Thanks for this! Is this how you would accomplish this or do you have a simpler approach?

    #91443

    devongroup
    Participant
    Post count: 18

    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.

    #91452

    Anita
    Blocked
    Post count: 7712

    So do you have this resolved now?

    #91454

    devongroup
    Participant
    Post count: 18

    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.

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Add blog to URL’ is closed to new replies.