Hello everyone,
Working away on one a template and I ran into a bit of a tricky situation (for me anyway).
I have a sub-navigation down the left side of my page displaying child pages. I want to draw different navigation icons for the menu based on info entered in the post_meta. I figured it would have to be done by including the post_meta code in the LI output somehow but I'm not sure how to fuse the two, if possible.
This is the code I'm using to display my child pages:
<?php if($post->post_parent)
$children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); else
$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
if ($children) { ?>
<ul id="subnav">
<?php echo $children; ?>
</ul>
<?php } else { ?>
<?php } ?>
And this is the code I would like to include into the LI output.
<img src="<?php echo get_post_meta($post->ID, 'icon', true); ?>" alt="Featured Post" />
Any and all help is possible. I'd like to do it without a plugin if possible, but will use as a last resort if necessary.
Many thanks to anyone who can help!
Mike