Custom field info in nav menu?
I’m trying to get custom field info from a page into the nav menu. I’ve had problems with this before… I just don’t “get” the walker menu and how it works.
Basically, In addition to the title of the page, I want to have it output the URL of an image and image description from the custom fields and create a menu item linked to a normal WP page.
In the nav-menu-template.php file, I’ve tried modifying the start_el function by adding get_post_custom_keys() like this with no success:
$item_output .= '<a'. $attributes .'>'; $item_output .= get_post_custom_values("product_image", $item->ID); $item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
I’ve also tried get_post_meta(); and others with limited success. The best I’ve been able to do is either get one of the images repeating in all the links by specifying a a hard integer value. Or, I’ve been able to get it to output the correct post/page value in text but without an image.
Anyone know of a solution.. what I’m doing wrong?
- The topic ‘Custom field info in nav menu?’ is closed to new replies.