Title: Query Posts Function not working
Last modified: August 19, 2016

---

# Query Posts Function not working

 *  [wireframe74](https://wordpress.org/support/users/wireframe74/)
 * (@wireframe74)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/query-posts-function-not-working/)
 * Hi I did a tutorial recently on how to create a loop that grabs information from
   pages with child pages to form a portfolio listing.
 * I am new to php and am getting an error on line 21 which apparently is where 
   the syntax for the array exists.
 * Below is my code..I have copied everything as well as I could from video tute(
   maybe as it was low res a curly brace may need to be a bracket or visa versa)
 *  <?php if ( (is_page(‘Portfolio’)) ) {
 * **query_posts{
    array(‘showposts’ => 100, ‘post_parent’=> 5, ‘post_type’ => ‘
   page’)); while (have_posts()) { the_post(); $thumbPath = get_post_meta($post-
   >ID, ‘thumbnail’, true; if($thumbPath ==”){ $thumbPath=”/images/comingsoon.gif”;
 * }
 * ?>
 * ” class=”portfolio_thumb”>
    <img src=”<?php echo $thumbPath ?>” alt=”#” /> <?
   php the_title(); ?> <?php echo get_post_meta($post->ID, ‘agency’ true); ?>
 *  <?php
 * wp_reset_query(); //Restore Global Post data
    } ?>

The topic ‘Query Posts Function not working’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [wireframe74](https://wordpress.org/support/users/wireframe74/)
 * Last activity: [16 years, 6 months ago](https://wordpress.org/support/topic/query-posts-function-not-working/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
