how to only get the image from a sub page?
-
Hi,
i am able to get the content from a sub page and display in a page a thumb preview; yet i only want to get the image and skip the text.
This is the code i am using:<ul class="thumb"> <?php $pages = get_pages('child_of='.$post->ID.'&sort_column=post_date&sort_order=desc&parent='.$post->ID); $count = 0; foreach($pages as $page) { $content = $page->post_content; if(!$content) continue; $count++; ?> <li cass="thumbList" > <a href="<?php echo get_page_link($page->ID) ?>"><h1 class="title"> <?php echo $page->post_title ?> </h1> <p><?php echo $page->post_content ?></p> <?php $key_1_value = get_post_meta($page->ID, 'Preview', true); print $key_1_value; ?> </a> </li> <?php } ?> </ul>
any idea please?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘how to only get the image from a sub page?’ is closed to new replies.