images in the wp_list_pages function?
-
There is so much information here, I need some help trying to find the right bits.
I’m trying to get the image that is associated with a Page to appear in the HTML of the navigation list that is created with the wp_list_pages function.
Right now I’m using the wp_list_pages on a parent page to list the children/subpages of it. Like this:
<ul>
<?php wp_list_pages('title_li=&child_of=5&sort_column=menu_order'); ?>
</ul>
Which returns this:
<ul>
<li class="page_item"><a href="Permalink-1" title="Page Title 1">My 1 Page Title</a></li>
<li class="page_item"><a href="Permalink-2" title="Page Title 2">My 2 Page Title</a></li>
<li class="page_item"><a href="Permalink-3" title="Page Title 3">My 3 Page Title</a></li>
</ul>
But what I’d like it to return is this:
<ul>
<li class="page_item"><a href="Permalink-1" title="Page Title 1">My 1 Page Title<span><img src="/image/associated/to/Page-1.jpg" width="350" height="246" alt="Page Title 1"></span></a></li>
<li class="page_item"><a href="Permalink-2" title="Page Title 2">My 2 Page Title<span><img src="/image/associated/to/Page-2.jpg" width="350" height="246" alt="Page Title 2"></span></a></li>
<li class="page_item"><a href="Permalink-3" title="Page Title 3">My 3 Page Title<span><img src="/image/associated/to/Page-3.jpg" width="350" height="246" alt="Page Title 3"></span></a></li>
</ul>
I’m looking at all the plugins and can’t figure out if any of them will do this. I’m looking at Kafkaesqui’s post image plugin that is talked about here.Anyone have any ideas? Am I barking up the right tree?
Thanks for thinking about it!
- The topic ‘images in the wp_list_pages function?’ is closed to new replies.