Solved

Wordpress PHP List Limited to 10 Items

Posted on 2016-07-17
3
70 Views
Last Modified: 2016-07-18
I'm helping out with a Wordpress site.  This client has a list of projects on a page that seems limited to displaying only the most recent 10 posts tagged as projects.  In looking at the PHP for this page, however, I can't find the variable that is restricting the list to only the most recent 10.  To confirm, there are currently 12 projects, only 10 listed, and if I create a new test project post, the oldest of the 10 is temporarily bounced from the list.  Could somebody suggest where to look so that I could expand the list to all project posts?  Current PHP for this page follows.

Thanks in advance!

<?php get_header(); ?>

<div id="content">

	<div id="contentleft">

        <div class="postarea">

            <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

            <div class="posttitle">
            	<h3><?php the_title(); ?></h3>
            </div>

            <?php endwhile; else: ?>

            <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>

			<?php endif; ?>
            	<?php
				echo '<div class="projects">';
				echo '<ul class="project-list">';
				$my_query = new WP_Query('post_type=project');
				if($my_query->have_posts()) : while($my_query->have_posts()) : $my_query->the_post();
					echo '<li><span><a href="#' . get_the_ID() . '" rel="facebox">';
					if(has_post_thumbnail()){
						the_post_thumbnail('project-thumbnail');
					}
					echo '</a><div class="expanded" id="' . get_the_ID() . '">';
					if(has_post_thumbnail()) {
						the_post_thumbnail('content-image');
					}
					echo '<br/>';
					echo '<h1>' . get_the_title() . '</h1>';
					the_content();
					echo '</div>';
					echo '</span><br/>';
					echo '<strong>' . get_the_title() . '</strong>';
					the_excerpt();
					echo '</li>';
				endwhile; endif;
				wp_reset_query();
				echo '</ul>';
				echo '<div class="clear"></div>';
				echo '</div>';
				wp_reset_query();
				?>

				<?php the_content(__('Read More'));?><div style="clear:both;"></div><?php edit_post_link('(Edit)', '', ''); ?>

        </div>

	</div>

<?php include(TEMPLATEPATH."/sidebar_right.php");?>

</div>

<!-- The main column ends  -->

<?php get_footer(); ?>

Open in new window

0
Comment
Question by:pcamis
  • 2
3 Comments
 
LVL 38

Accepted Solution

by:
Tom Beck earned 500 total points
ID: 41716178
Maybe just a post-per-page limit set in the Wordpress configuration. Have a look here.
1
 

Author Closing Comment

by:pcamis
ID: 41716228
Exactly right - thank you very much!  Knew I was missing something simple and obvious but couldn't put my finger on it.
0
 
LVL 38

Expert Comment

by:Tom Beck
ID: 41717023
You're welcome. Thanks for the points.
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MySQL limit and not so limited 13 33
e-commerce site using wordpress 4 22
MySQL-Design Help 12 38
Wordpress Carousel Not Working All of a Sudden 2 14
When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question