WordPress.org

Ready to get started?Download WordPress

Forums

WP-Paginate
wp-paginate in a custom post loop (3 posts)

  1. hafman
    Member
    Posted 2 years ago #

    Hello,

    I'm having a pleasant afternoon, trying everything i can find to make this work. It did work before but no joy in my current theme.

    I have a page with the following code in it. Does all the displaying of post loop but will not paginate

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    
    $xib = new WP_Query( array(
    'post_type' => 'exhibitions',
    'posts_per_page' => 6,
    'orderby' => 'menu_order',
    'order' => 'ASC',
    'paged' => $paged
    						) );
    while ( $xib->have_posts() ) : $xib->the_post(); ?>
    	<div id="recordwrap">
    	<div id="record" class="storycontent">
    <p class="storytitle"><?php the_title(); ?></p>
    <?php the_content('more..'); ?>
    </div>
    
    <div id="featuredimg">
    <?php
     if ( has_post_thumbnail()) {
       $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full');
       echo '<a href="' . $large_image_url[0] . '" rel="shadowbox[ex]" title="' . the_title_attribute('echo=0') . '" >';
       the_post_thumbnail('thumbnail');
       echo '</a>';
     }
     ?>
    
    </div>
    		</div>
    <?php endwhile; ?>
    <?php if (function_exists('wp_paginate')) {
        wp_paginate();
    } ?>

    http://wordpress.org/extend/plugins/wp-paginate/

  2. imagebox
    Member
    Posted 2 years ago #

    Did you find a solution to this? I am also looking into how to use this plugin with a similar custom loop.

  3. hafman
    Member
    Posted 2 years ago #

    I did in the end after trying mod rewrite hacks and plugins. The rewrite thing however led me to sort out my custom post type in functions.php so that i had

    'rewrite' => Array('slug' => 'exhibition')

    in the array under register_post_type

    That made everything work. So i'd say sort out the functions first.

    In other words the path to the pages was being messed up, hence the 404.

    I went with wp_navi in the end too because i wanted page breaks that looked consistent with the archives. wp-paginate doesn't do page breaks yet as far as i know.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic