• Resolved nitm

    (@nitm)


    Hey,

    I have this problem which I just can’t find a solution to, and I’ve searched and tried for some time now.

    I want my site, which is completely based on wordpress, to have a structure similar to this:
    About
    ….Who are we?
    ….Blog
    ….Links
    ….Contact
    Seminars
    ….Schedule
    ….Teachers
    ….Articles
    Page 3
    ….Page 3.1
    ….Page 3.2

    All of the items in the list are pages, except for the blog which is supposed to be the regular default index file in wordpress which displays the last posts.

    Also, I would like the permalinks to have the same structure:
    /about
    /about/who
    /about/blog
    /about/links

    And the posts (in single) will have the following format:
    /about/blog/%year%/%monthnum%/%day%/%postname%/

    I already created a thread in How-To and Troubleshooting forum but it got no attention at all, and I thought that putting it here and maybe explaining exactly what I’m after will help.

    My current status is this:
    I managed to have all the pages in the wanted hierarchy and they have the wanted permalinks.
    The posts also have the wanted permalinks by putting the above format in the Custom Structure (Settings > Permalink Settings).

    What’s problematic:
    1. I can’t seem to move or mimic the behavior of the index.php file into /about/blog/ url.
    I even tried creating that directory structure under the root and placing a index file there which loads the wp-blog-header.php of the root, but the title of the page is “page no found” and even though the index.php of my template is being called, the loop does not produce any content.
    2. In all the pages there’s a side menu with only the sub pages of the same parent. I’m doing that using wp_list_pages and I give it the id of the page if it’s a root page (About, Seminars, Page 3…) or the id of the ancestors if it’s a child page (I only have this 2nd level).
    I want to be able to know when displaying posts (index or single) that the post is under the About page so that it can display the correct side menu.

    I really hope that this post makes it clear, because I’ve been searching the web for almost two weeks now (on and off) trying to come up with a way to accomplish this.

    would appreciate any help, thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • I want to make sure I understand your question correctly so these are the assumptions I am making.

    You want your site to have a static front page that does not show the most recent posts.
    https://example.com – static front page
    You wish for all your posts to appear under the about/blog page.
    https://example.com/about/blog – all your posts

    You currently have your pages in the required parent-child relationship (hierarchy).

    Are you using the default Twenty-Eleven theme, another theme or a custom theme?

    In brief, you need to set a static page as your front page ( admin->settings->reading: Front page displays ). Then create a template that displays your posts. Assign that template to the page ‘blog’ you have created.

    Thread Starter nitm

    (@nitm)

    I have more than one static page, the site is made up by 10-20 (or more) static pages, which are arranged in a parent-child relationship (pages and sub pages, just 2 levels).

    all of the static pages have the permalink url structure of /parentPage/childPage/, or just /parentPage/.

    the posts i want to be under a certain parent page (the about), as if they are all collected under blog (and i’ll have /about/blog/).

    all of my posts now have permalinks of type /about/blog/2011/may/10/Hello – which is exactly what i want.

    the problem is how to have “The Loop” running in /about/blog/index.php?
    the page does not exist… and even if i create this directory structure under the root, and i include the wordpress from within that directory, the index.php is being called alright, but “The Loop” produces no content, as if wordpress have no idea what’s going on.

    i created my own theme, built on top of the TwentyEleven one.

    thanks!

    Couple things first, you do not need a page named index.php beneath your about/blog structure. Also, did you create a child theme or did you modify Twenty-Eleven?

    This works if you have a child theme of Twenty-Eleven. I can’t vouch for it if you have significantly customized your theme.

    Step 1: Go to the admin dashboard->settings->reading
    Step 2: Set your Front Page Displays setting to ‘A static page’ – choosing which page you want to be the front page
    Step 3: Choose your blog page to be the posts page.

    When you visit your site you will now see the static page you indicated as the root and all your posts will appear under about/blog.

    Thread Starter nitm

    (@nitm)

    omg!

    wow, so easy!!!!
    how on earth did i miss the “posts page”?!

    thanks a lot for pointing that out.

    You bet. Glad you got it figured out.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘have all posts under a page (structure wise) ?’ is closed to new replies.