Support » Fixing WordPress » Need help with Structure of my website, getting Posts to behave like Pages

  • Resolved quirksmode



    I have held off asking for help on this for a while, hoping that I would find the answer for myself, but things have gotten quite desperate now. I hope I can explain this properly:

    I am building myself a website that will contain both my Portfolio and a Blog. The address is:

    Website Link

    The Portfolio and Blog Items are stored as posts, with some PHP to work out which is which and display a different template to each.

    The portfolio page has 5 subpages.

    ¦ ¦ ¦ ¦ ¦
    Websites Games Interactive Banners Clients

    These pages all share the same template which contains Code that displays all the posts contained within the category that matches the pages name. This part works fine, and I even managed to get the subnav to render correctly.


    It happens the moment I try to click on one of the Individual Portfolio links. It displays fine, but the nav and subnav falls apart. The breadcrumb also goes wrong (though i have hacked that so it works for now, not ideal:-().

    I am guessing the reason is because I am technically not within the Portfolio folder anymore, even though the url displays perfectly.

    Is there a way of telling these posts that they belong to a certain page so the structure remains intact?

    Could I create pages of the same name as the posts and somehow link to them through the category list display? (e.g. instead of it loading the post up, it loads a page up that contains the single post). This sounds like it would double effort and I would love to avoid this if possible.

    I hope that made sense, its been driving my crazy for a long time now, I have searched high and low for examples of other portfolio sites set up like mine, but none seem to have more than 2 levels.

    From a Usability point of view I would love to get this working dynamically and avoid hacks, but I am getting pretty desperate, any help is really appreciated,


Viewing 4 replies - 1 through 4 (of 4 total)
  • Just to make sure I understand the issue, and from looking at your site.

    You click on your portfolio, then the submenu appears. You click on websites, and a list of sites comes up, you click on one of them, but then the submenu disappears, but you still want it there. Is that the problem?

    Assuming all your posts listed under ‘website’ are in a ‘website’ category, with an ID of 1, you could use something like

    <?php if (is_single())&&(in_category(1))
    { echo 'here is my submenu php/html stuff';
    } else {
    echo 'whatever';

    maybe i missed something though, so sorry if that wasnt what you were looking for! 🙂

    Hi, getting it to work out whether its in the right category isn’t the problem. My problem is getting the actual code to generate a working subnav. For some reason when its viewing an individual portfolio link, all the code stops working. The breadcrumb does not work properly either. I am using fold_page_list plug in for the navigation btw

    Maybe if we could see how you are trying to do it at the moment, that might help us figure it out?

    Hi, sorry for late reply, have been away. I managed to figure it out, the problem was that my page structure was not set up properly. When i clicked on the post it was navigating to the blog which broke the navigation.

    To solve this I created pages that display a single post of the same name. This way I can maintain a solid navigation whilst being able to store all my info as posts.

    This is the code I am using for my subnav

    <div id="subNav">
    	$g_page_id = $wp_query->get_queried_object_id();
    	$ancestorIDs = _wswwpx_page_get_ancestor_ids($g_page_id);
    	$thispage = $wp_query->post;
    	else if($thispage->post_parent!=0) //if not top level
    	else //if top level

    Its not perfect because it is using page id to determine where it is and the page id could change if I added more pages furthur down the line. Would love to know what the perfect guru code for this would be.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Need help with Structure of my website, getting Posts to behave like Pages’ is closed to new replies.