Title: .php template help &#8211; query string
Last modified: August 19, 2016

---

# .php template help – query string

 *  Resolved [bespokeordie](https://wordpress.org/support/users/bespokeordie/)
 * (@bespokeordie)
 * [16 years, 12 months ago](https://wordpress.org/support/topic/php-template-help-query-string/)
 * Hello,
 * I am working with a page .php template to create an image gallery with pagination
   showing 30 images per page. The page as it looks now can be found here:
 * [http://www.bespokeordie.com/image-gallery/](http://www.bespokeordie.com/image-gallery/)
 * This is the code I am using:
 *     ```
       <?php/*Template Name: Image Gallery Full*/?>
   
       <?php get_header(); ?>	
   
       <!-- Middle Starts -->	
   
       <div id="middle-out-top">
       <div id="middle-out-bottom">
       <div id="middle-content" class="full">
       <div id="middle-content-bottom" class="full">		
   
       <!-- Content Starts -->		
   
       <div id="content" class="wrap full">
       <div id="main-content" class="fullwidth">
       <div class="page post wrap">					
   
       <br /><br />            						
   
       <h2 class="arh"><?php the_title(); ?></h2>			                            
   
       <?php query_posts('showposts=30'); ?>
       <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
       <?php $wp_query->is_home = false; ?>
       <?php woo_get_image('image','thumbnail','','','thumbnail gallery'); ?>
       <?php endwhile; endif; ?>	
   
       <div class="more_entries wrap">
       <?php if (function_exists('wp_pagenavi')) { ?><?php wp_pagenavi(); ?><?php } ?>
       </div>
       </div>
       </div>
       </div>		
   
       <!-- Content Ends -->	
   
       </div>
       </div>
       </div>
       </div>	
   
       <!-- Middle Ends -->	
   
       <?php get_footer(); ?>
       ```
   
 * I have tried doing my homework, but failed multiple times with the $query_string
   function. See my previous failed attempts here:
 * [http://wordpress.org/support/topic/280185?replies=8](http://wordpress.org/support/topic/280185?replies=8)
 * Does anyone have any suggetions? This code is so small and so basic, yet I am
   struggling over and over again. Please help.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [bespokeordie](https://wordpress.org/support/users/bespokeordie/)
 * (@bespokeordie)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/php-template-help-query-string/#post-1113942)
 * Bumpy?! So I tried a variant of this code:
 * $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
    query_posts(…
 * I thought I was on to something, but again, no such luck. Is this code really
   that hard to figure out?
 *  Thread Starter [bespokeordie](https://wordpress.org/support/users/bespokeordie/)
 * (@bespokeordie)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/php-template-help-query-string/#post-1113997)
 * bump?
 *  Thread Starter [bespokeordie](https://wordpress.org/support/users/bespokeordie/)
 * (@bespokeordie)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/php-template-help-query-string/#post-1114075)
 * bump bump bump.
 *  Thread Starter [bespokeordie](https://wordpress.org/support/users/bespokeordie/)
 * (@bespokeordie)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/php-template-help-query-string/#post-1114157)
 * Anyone have any fresh thoughts? I would really like to make this work.
 *  Thread Starter [bespokeordie](https://wordpress.org/support/users/bespokeordie/)
 * (@bespokeordie)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/php-template-help-query-string/#post-1114189)
 * still trying. 🙂

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘.php template help – query string’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 1 participant
 * Last reply from: [bespokeordie](https://wordpress.org/support/users/bespokeordie/)
 * Last activity: [16 years, 9 months ago](https://wordpress.org/support/topic/php-template-help-query-string/#post-1114189)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
