rhwinter
Forum Replies Created
-
Forum: Plugins
In reply to: Get the menu item ID of a page if part of a custom menuOh dear!!!
I’ve looked for this for so long, thanks a lot. I’ve even tried to understand how WordPress’ Walker class generates its menus ids, but I just got as far as seeing that each $item has a weird ‘db_id’ property — something which I couldn’t understand, all I got of it was that it, further down, translates (is used) as $element->ID, which is really confusing since one might think that is the same as $post->ID, while it isn’t! This is really confusing when trying to get the current item’s (page, post, etc) CSS class or id’s current-menu-id since it does not match the current item’s proper ->ID variable…
Some of the things I searched for before finally getting here:
menu id number
menuid number
menu-item id number
menu-item id walker corresponding number
menu-item walker corresponding number
menu-item corresponding number
menu item corresponding number
menu item number
display_element
walk
nav-menu
nav-menu-template
start_el
current-menu-item
current-menu-item-id
current-menu-item-id-numberMaybe these will help people searching on Google and whatnot.
Cheers!
Forum: Themes and Templates
In reply to: orderby=name not working in get_poststry using “title” instead of “name”.
so for example, Brad, your code would become:$myposts = get_posts('post_parent='.$pageID.'&numberposts=-1&post_type=page&orderby=title&order=ASC');it seems to work for me.