WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] get_pages - grandchildren only (2 posts)

  1. giographix
    Member
    Posted 1 year ago #

    hello

    i am trying to use get_pages to display only the grandchildren of 1 page. any help is greatly appreciated. thank you

    <?php
    	$args = array(
    		'post_type' => 'page',
    		'post_status' => 'publish',
    		'child_of' => 8
    		);
    	$attachments = get_posts($args);
    	if ($attachments) {
    		foreach ($attachments as $post) { ?>
    
    			<div class="portfolio_grid_thumbnail"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('100,100') ?></a></div>
    
    			<div class="portfolio_grid_title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div>
    
    		<?php
    		}
    	}
    ?>
  2. giographix
    Member
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Topic