Forums

Adding an image to each wp_list_pages result (4 posts)

  1. buskerdog
    Member
    Posted 2 years ago #

    I'm trying to figure out how to add an image to each result when using wp_list_pages. I'm going to style the image so it appears under the name of the page.

    Basically I want wp_list_pages to kick out something like:
    <li>Link text <div class="link-image"><img src="img-url" /></div></li>

    I'm open to doing this however. The method I'm trying is to make a custom field for pages where HTML for an image can be pasted and called in the wp_list_pages loop, something like this:

    $meta_key="menu_image";
      echo wp_list_pages("title_li=&child_of=".$post->ID."&echo=0&link_after=".$meta_value);

    But it doesn't work. I'm not married to this approach. For example, if there's a plug in or any other method that will give me what I need I'll do that instead...

  2. buskerdog
    Member
    Posted 2 years ago #

    Nobody? It seems like this would be something that could be done...

  3. buskerdog
    Member
    Posted 2 years ago #

    I'm doing it with the category page plugin in a fairly convoluted way. If anyone has another answer I'd love to hear it.

  4. maorb
    Member
    Posted 2 years ago #

    Will be happy also for solution to that, I'm just looking for now and didn't find yet. What is the category page plugin?

Topic Closed

This topic has been closed to new replies.

About this Topic