• Hello all…
    I have a website http://www.anvllc.com under development.

    I am getting close to going live but have one issue. I want to display the menu when enter into a single post view using single.php.

    single.php make the call to sidebar but the routine in there uses the current page. When you go to a single view you loose the page information…. is there some quick trick to solving this issue?

    Go to this page… and click on one of the products and the menu goes away. I don’t want this to happen.

    Thanks for your help in advance.
    -D

Viewing 6 replies - 1 through 6 (of 6 total)
  • Can you drop a copy of your sidebar file into the WordPress pastebin?

    Thread Starter i3

    (@i3)

    esmi… here is the copy of the sidebar (Paste bin)

    —- DESCRIPTION —-
    to: esmi
    from: I3
    Re: Singlepost with menu on it???

    Using wordpress, how do you get a menu function to display the last menu when a single post is invoked. My problem is that when you click on the post in a defined page, WP executes the single post and WP looses “page” context. How does someone get around this? Is there a way to maintain state without having a user login?

    Thread Starter i3

    (@i3)

    test

    Hang on a minute… You mentioned single.php (which displays a single post rather than a page). Yet your sidebar is based purely on pages. As a result, there’s no direct connection between the single post and the page that led to it. Posts and pages don’t mix. I can’t even follow the logic in your urls to suggest a solution. The urls of (what I assume are) the single posts don’t bear any relationship to the page on which they’re listed, so there’s nothing that can be used there either.

    I don’t think it’s your sidebar that needs to be amended as the site architecture/logic.

    Thread Starter i3

    (@i3)

    Okay, here is what I did and how the relationship works.

    I setup the site up so pages are just pages. 4 of those pages list the products in different ways (manufacture, software, by type, by application). The products themselves are really posts. The page template was setup so it only displays posts where the page name and category match. (there is a category for every sorting method).

    What this does is allows me to create one product post which can be sorted based on how the viewer wants to look at it. Site users can approach what their looking for from different angles. (i.e “let me see all TVs” or “Let me see all products from a manufacture”. I thought this was quiet ingenious because it allows my customer to maintain their products as posts. My customer is not e-commerce site due to the complexity and cost of the products the sell so I didn’t really consider an advanced commerce type of system.

    So all said and done the sorting method works wonderful and the only kink in my plan is that loose page context when I viewer want to view the details of the product. I can’t build the context from the post because I don’t know which page “view” they came in through.

    – Is there a carry state (such as what page did I just come from) which I can build logic to rebuild the menu?
    – Is there an add-in would be better?

    Sorry for the book, but I hope it explains the “use case” for what I did, even if it wasn’t the best way of doing something.

    Is there a carry state (such as what page did I just come from) which I can build logic to rebuild the menu?

    Not within WordPress that I know of. Seems to me that you’re best looking at using plain old PHP to grab the referrer url and parse it to get the page slug. From that point, you could use get_page_by_path to retrieve all of the WP data for the referring page.

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

The topic ‘Singlepost with menu on it???’ is closed to new replies.