treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Wordpress - /blog - parent/child - I'll try to explain :)

  • I have a WordPress site that is made up of several WP Pages with custom templates assigned and a blog. The blog is also a WP Page with a custom template. The blog articles are found at domain.com/blog. This is what I want. However when you go to the individual blog article it's domain.com/individual-blog-article-title rather than domain.com/blog/individual-blog-article-title.

    Is there a setting that allows me to keep the /blog in front of the singe blog posts?

    Not sure if this matters but the actual directory structure is:

    root
     > wordpress
     > wp-content
       >> themes
       >> plugins
    

    The site is on a dev server here: http://mhopple.com.s163682.gridserver.com/ http://mhopple.com.s163682.gridserver.com/blog/ http://mhopple.com.s163682.gridserver.com/trend-watch-going-coastal/

  • Settings > Permalinks.

  • Thanks for the response! I've tried messing with the permalinks structure. But I'm not sure that's exactly what I'm looking for. I think that effects the site as a whole—rather than just the blog pages, right?

    So what I tried was this:

    Custom Structure: /%category%/%postname%/

    Custom category base: blog

    But then I'd have to make sure that every post has a category of "blog" right? Plus that makes all the other pages (non-blog pages) have "blog" in the url.

    Is that inline with what you were thinking or what would you recommend TheDoc? Is there a way to only effect the permalink structure of certain pages? Or perhaps I have a larger issue?

  • But then I'd have to make sure that every post has a category of "blog" right? Plus that makes all the other pages (non-blog pages) have "blog" in the url.

    Nope! It will just make sure to insert /blog before the category.

  • I think that you have to enter the following line in the "custom structure" setting:

      /blog/%category%/%postname%/
    

    However, with that setting, pretty much your entire site will be behind that "/blog" part (all posts, pages, and listings).

    If you want to effect the permalink structure of certain pages, you can set that for every single individual blog post or page. If you're creating/editing a post, under the Title field, hit EDIT and then you can set the permalink for that post only.

    @TheDoc, correct me if I'm wrong!

  • @Senff - that's right, but instead of doing that you can set the category base like the OP mentions above. That will only affect blog posts.

  • Right! Should try that out myself.