• is there any way to paginate pages? i am using a real estate plugin that requires the individual listings to be pages and i would really love to be able to paginate the main listing page so it isnt so long. does anyone know how to do this? i’ve looked on google and through the plugins but cant find anything.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • You can paginate a page, by inserting a <! read more > tag into it. You can find the read more tag in the icons above the edit screen. It wouldn’t really ‘paginate’ a page. But it would break it up for your readers.

    Well this as page.php in the WordPress Default theme provides a paginated list of pages.

    <?php
    get_header(); ?>
    	<div id="content" class="narrowcolumn" role="main">
    
    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args=array(
      'paged' => $paged,
      'orderby' => 'date',
      'order' => 'ASC',
      'post_type' => 'page',
      'post_status' => 'publish',
      'posts_per_page' => 3,
      'caller_get_posts'=> 1
    
    );
    query_posts($args) ;
    
    ?>
    
    <?php if (have_posts()) : ?>
    
    		<?php while (have_posts()) : the_post(); ?>
    
    			<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    				<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    				<small><?php the_time('F jS, Y') ?>  by <?php the_author_posts_link() ?> </small>
    
    				<div class="entry">
    					<?php the_content('Read the rest of this entry &raquo;'); ?>
    				</div>
    
    				<p class="postmetadata"> <?php edit_post_link('Edit', '', ' | '); ?>  </p>
    			</div>
    
    		<?php endwhile; ?>
    
    		<div class="navigation">
    			<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
    			<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
    		</div>
    
    	<?php else : ?>
    
    		<h2 class="center">Not Found</h2>
    		<p class="center">Sorry, but you are looking for something that isn't here.</p>
    		<?php get_search_form(); ?>
    
    	<?php endif; ?>
    
    	</div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>
    Thread Starter jenyus

    (@jenyus)

    so how does it divide up the page? the real estate plugin lists all the pages in the same way that wordpress lists the posts by default. you can see what i mean here: http://quailpropertymanagement.com/home/rentals. Here is an idea that i had that almost works:
    I have this little bit of code to increment a counter.
    i declare this before the loop: <?php $postnum = 1; ?>'
    then this in the loop:
    `<?php echo “listing number:” . $postnum++ . “
    \n”;?>
    <?php if ($postnum == 6)
    echo “<!–nextpage–>”; ?>

    I did this so that on every 6th listing it would create a new page. but, <!--nextpage--> just displays as a regular html comment when executed in the php file. what code does <!--nextpage--> pull? could i just stick that in?

    Thanks!

    Sorry I misunderstood–you want to split one page in to multiple pages.

    Yes you would use the <!--nextpage--> to specify where the ‘splits’ are to occur, then use the template tag, wp_link_pages(). Look at the WordPress Default themes wp-content/themes/default/page.php for an example of that.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘paginate pages?’ is closed to new replies.