Subpages displayed on Parent page w/ image
-
I am building a website at a2zanimals.info and I want to utilize the power of wordpress to display the subpages when I click on the parent page.
For instance, when I click on the Animals Photos page, I want it to display links to all the subpages underneath it (only one level), which I have, but I also want it to display an image next to the link.
Here is the code I am using to get the subpages listed<?php $output = wp_list_pages('echo=0&depth=1&title_li=' ); if (is_page( )) { $page = $post->ID; if ($post->post_parent) { $page = $post->post_parent; } $children=wp_list_pages( 'echo=0&child_of=' . $page . '&title_li=' ); if ($children) { $output = wp_list_pages ('echo=0&child_of=' . $page . '&title_li='); } } echo $output; ?>
I was considering using something like
<img src="<?php $key="thumbnail"; echo get_post_meta($post->ID, $key, true); ?>" alt="<?php the_title() ?>" />
on the subpages to display the images, but I don’t know where I would put it or if it is the best option.Can anyone help?
- The topic ‘Subpages displayed on Parent page w/ image’ is closed to new replies.