php - Wordpress custom field only displaying 10 posts -


i've used wordpress advanced custom fields plugin make portfolio page. i've setup fields image, title, category , yes/no weather project featured.

my code project page follows:

<?php      $args = array(         'post_type' => 'project'     );      $query = new wp_query( $args );  ?>  <?php starkers_utilities::get_template_parts( array( 'parts/shared/html-header', 'parts/shared/header' ) ); ?>  <h1 class="lead"><?php the_title(); ?></h1>  <div id="triggers">     <strong>filter:</strong>     <span id="filterdouble">filter all</span>        <span id="filter1">filter 1</span>     <span id="filter2">filter 2</span> </div>  <ul id="gallery" class="group">     <?php if ( have_posts() ) while ( $query->have_posts() ) : $query->the_post(); ?>          <li class="gallery_image" data-id="id-" data-type="<?php the_field('project_category')?>">                  <a rel="prettyphoto[gallery]" class="zoom" href="<?php echo the_field('image') ?>">                      <img class="mag" src="<?php bloginfo('template_url'); ?>/imgs/mag.png"/><div class="thumb_bg"></div>                     <?php the_post_thumbnail('portfolio'); ?>                 </a>                                               </li>     <?php endwhile; ?> </ul> 

everything works fine, can add projects. my problem starts when hit 10 projects. after 10, doesn't display anymore. using jpages (jquery plugin) , filtrify add filters filer out categories. work fine, can filter category , see correct images. plugin scripts removed, still see max of 10 posts. adding more 10 pushes earlier images off , displays 10 latest.

so how can stop being 10.. jpage script sets pagination 12 per page, doesn't chance kick in. thinking it's post problem i'm it's not scripts.

i think i've traced issue - tested this: 'posts_per_page' => '20' - display missing posts, don't want set number might need lots. how can define unlimited number. providing issue..

if other code needed, please let me know, think main part of what's controlling posts appearing on page.

you're on right track.set value -1 desired results.

link documentation: http://codex.wordpress.org/class_reference/wp_query#pagination_parameters

posts_per_page (int) - number of post show per page (available version 2.1, replaced showposts parameter). use 'posts_per_page'=>-1 show posts. set 'paged' parameter if pagination off after using parameter.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -