WordPress.org

Ready to get started?Download WordPress

Forums

Syntax Q: Trying to display Child Pages + Featured Image in page order (1 post)

  1. sharpfield
    Member
    Posted 1 year ago #

    So I've got a page on my website where I've managed to display all the Featured Images from the page's Child Pages, using this code:

    <?php $pages = get_pages(array('child_of' => 19)); ?>
    	<ul>
        		<?php foreach ($pages as $page): ?>
         			 <li>
             			<?php echo get_the_post_thumbnail($page->ID, 'thumbnail'); ?>
    			</li>
    		<?php endforeach; ?>
    	</ul>

    Now I'd like to know how I can display these Child Pages in Page Order, as well as that I'd like the Featured Images to be linked to the Child Pages (i.e. you're able to click on them to go to the Child Page).

    Any help would be amazing, I've had a few attempts but I'm pretty dusty with my WordPress / PHP syntax!

Topic Closed

This topic has been closed to new replies.

About this Topic