wp_list_pages syntax question
-
Hello
I’m attempting to alter the wp_list_pages function to output not only the page titles as links but to include thumbnails from each of the pages custom fields.
I’ve tracked down the code to the classes.php page and have amended the code to include an image within the li …
$output .= $indent . '<li class="' . $css_class . '"><a href="' . get_page_link($page->ID) . '" title="' . esc_attr(apply_filters('the_title', $page->post_title)) . '"><img src="' . get_post_meta($post->ID, "Thumbnail", true) . '">' . $link_before . apply_filters('the_title', $page->post_title) . $link_after . '</a>';
Currently it outputs this source code for each li…
<li class="page_item page-item-57"><a href="https://localhost/mysite/page_id=57" title="extra article"><img src="">extra article</a></li>
As you can see the image src is blank.
Could anyone please help me to get the syntax right? My php is rusty at best.
Thanks in advance.
- The topic ‘wp_list_pages syntax question’ is closed to new replies.