• Hi,
    I am getting the content from sub pages using this:

    <?php $pages = get_pages('child_of='.$post->ID.'&sort_column=post_date&sort_order=desc&parent='.$post->ID); foreach($pages as $page) { $content = $page->post_content; if(!$content) continue; ?>
    	<li cass="thumbList" >
    		<a href="<?php echo get_page_link($page->ID) ?>" class="clearfix" ><h1 class="title"> <?php echo $page->post_title ?> </h1>
    		<?php $key_1_value = get_post_meta($page->ID, 'Preview', true);
    		print $key_1_value; ?></a>
    	</li>
    <?php } ?>

    I need to be able to insert: <?php get_the_image(); ?> as I do for the meta

    Any idea?

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

    (@downfast)

    err yeah..thanks
    I am using a plugin which works just fine; all i need to do is to be able to run it via the loop i am using to diplay the other information e.g the meta

    basically something like:

    <?php $pages = get_pages('child_of='.$post->ID.'&sort_column=post_date&sort_order=desc&parent='.$post->ID); foreach($pages as $page) { $content = $page->post_content; if(!$content) continue; ?>
    	<li cass="thumbList" >
    		<a>ID) ?>" class="clearfix" ><h1 class="title"> <?php echo $page->post_title ?> </h1>
    <?php get_the_image(); ?>
    		<?php $key_1_value = get_post_meta($page->ID, 'Preview', true);
    		print $key_1_value; ?></a>
    
    <?php }

    Any idea?

    What about the_meta? See Custom Fields

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Insert code in a loop of subpages’ is closed to new replies.