• 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…

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter buskerdog

    (@buskerdog)

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

    Thread Starter buskerdog

    (@buskerdog)

    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.

    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?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Adding an image to each wp_list_pages result’ is closed to new replies.