WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How Do I limit The Number Of Posts Appearing On My Homepage? (3 posts)

  1. Phildub
    Member
    Posted 5 years ago #

    Hello,

    I am using - and adapting - the excellent template MassivePress. Currently, it seems to have no limitation on the number of posts that will appear on th ehomepage and I'd like to know if there is some way of doing this.

    My understanding is that the limitation would properly appear in the index.php code - So The main index page code is as follows:

    <?php get_header(); ?>
    <div id="mid" class="fix">
    	<div id="mainCol" class="fix"><a name="main"></a>
    	<?php if (have_posts()) : ?>
    	<?php while (have_posts()) : the_post(); ?>
    		<div id="postMain">
            <div class="post" id="post-<?php the_ID(); ?>">
    			<div class="postMeta"><span class="date"><?php the_time('M j, Y') ?></span><span class="comments"><?php comments_popup_link('0', '1', '%'); ?></span></div>
    			<h1><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title() ?></a></h1>
                <h5>Categories: <?php the_category(', '); ?></h5>
    			<div class="entry">
                <div id="introIMG"><a href="<?php the_permalink() ?>" class="Tips2" title="Read More... :: Click here to read the rest of this entry."><img src="<?php $key="thumbnail"; echo get_post_meta($post->ID, $key, true); ?>" alt="<?php the_title(); ?>" /></a></div>
    			<a href="<?php the_permalink() ?>" class="Tips2" title="Read More... :: Click here to read the rest of this entry."><p><?php the_content_rss('', TRUE, '', 200); ?></p></a>
    			</div>
    		</div>
            </div>
    		<?php endwhile; ?>
    		<?php else : ?>
    		<div class="post">
    			<div class="postMeta"><span class="date">No Matches</span></div>
    		<h1>No matching results</h1>
    			<div class="entry">
    			<p>You seem to have found a mis-linked page or search query with no associated results. Please trying your search again. If you feel that you should be staring at something a little more concrete, feel free to email the author of this site or browse the archives.</p>
    			</div>
    		</div>
    		<?php endif; ?>
    		<div id="more_reading">
            	<?php next_posts_link('<span class="navforward"></span>') ?><?php previous_posts_link('<span class="navback"></span>') ?>
    		</div>
    	</div>
    	<?php include (TEMPLATEPATH . '/second.php'); ?>
    	<?php include (TEMPLATEPATH . '/third.php'); ?>
    </div>
    <?php get_footer(); ?>

    Thank you,
    P

  2. buddha trance
    Member
    Posted 5 years ago #

    Go to your admin dashboard --> Settings --> Reading.

    There you will find "Blog pages show at most (# of) posts". Set the number you want there.

  3. Phildub
    Member
    Posted 5 years ago #

    Thank you - I was over-complicating it, clearly.

Topic Closed

This topic has been closed to new replies.

About this Topic