Child pages post_thumbnail
-
I have the following code, which is meant to pull in the child page’s of the page ID 14 featured image, and I can’t work out why it’s not working. It’s doing nothing at all…
<?php $ID = get_the_ID(); $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("post_type=page&post_parent=$ID&order=ASC&orderby=menu_order&child_of=14&posts_per_page=1&paged=$paged"); while ( have_posts() ) : the_post(); ?> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" > <?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?> </a> <?php endwhile; ?> <?php wp_reset_query();?>I also changed this code around to display
<?php query_posts("post_type=page&order=ASC&orderby=menu_order&child_of=14&posts_per_page=2"); while ( have_posts() ) : the_post(); ?> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" > <?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?> </a> <?php endwhile; ?> <?php wp_reset_query();?>Which outputs the anchor tags but not the child pages of 14 – it just outputs all the pages.
Any help would be really appreciated.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Child pages post_thumbnail’ is closed to new replies.