Current POD page and wp_page_menu

0

This might be really simple to solve... I have set up a pod, pod listing page and detail page as per instructions. These pages show up and link through fine. No issues here.

However, WordPress seems to nothing about the current page id or ancestry of any of my Pod Pages. So, the main menu gets out of sync - it is setting the current_page_parent item incorrectly as the default post page.

E.g. If click on an event and go to that detail page, in the main menu the 'News' item is highlighted as the current section. It should be 'Events'. The Url is showing correctly as /events/my-event

I'm using the Thematic framework which uses wp_page_menu to generate the menus.

I feel I'm missing something really obvious. Any ideas?

asked Mar 10 '10 at 4:41

Ian

11

add comment
enter at least 15 characters

5 Answers

1

Thanks for the reply logikal16, I feared as much, but was hoping for an easy way out! I think the approach will be to query the pod id and then use jQuery to intercept the menu structure. If i get anywhere with this, I'll post it up.

answered Mar 10 '10 at 4:41

Ian

11

add comment
enter at least 15 characters
0

Long story short, WordPress isn't aware that Pod Pages even exist. Unless there's a way to manually override "current_page_parent", you may have to add some CSS or Javascript to your Pod Page in order to change the active menu item.

answered Mar 9 '10 at 7:34

logikal16

249

add comment
enter at least 15 characters
0

any luck here Ian? I am looking for the same fix, and it feels very hacky to use JS and CSS to fix this. Isn't there a precode approach we could use in the templates to tell wordpress "this is the location of this page"?

answered Jun 26 '10 at 2:52

matsh

16

add comment
enter at least 15 characters
0

I ended up using CSS to highlight the current top level menu item. I used a function which add a 'pods' class to the body tag which I think I got from this forum - copied below. Then I know if we're in a pods section and use CSS to apply the background image. Not great, and custom drop down menus are not assigned the current_page class.

What puzzles me is how come no-one else needs this functionality? Surely basic site navigation matters to everyone.

    function pods_body_class($classes)`{
    global $pods;
    if (function_exists('is_pod_page')) {
        if (is_pod_page()) {
             $classes[] = "pod";
            if( is_object($pods) )
            {
                $classes[] = "pod-".$pods->datatype;
            } 
           $classes[] = ' '.pods_url_variable(-2).' '.pods_url_variable('last');
        }
    }
    return $classes;}
    add_filter('body_class','pods_body_class');

answered Sep 3 '10 at 11:05

Ian

11

I'm with you here, Ian. I just want to be able to hook my top nav ( a wp_nav_menu) when I'm deep in my display of PODS. A JQuery/JS hack for now I think. I'm sure the PODSters will be all over it in time. Jon – jonlee Sep 4 '10 at 1:21
add comment
enter at least 15 characters
0

Pods adds Body Classes as of Pods 1.9.0

answered Oct 17 '10 at 12:26

sc0ttkclark

2123

add comment
enter at least 15 characters