WordPress.org

Ready to get started?Download WordPress

Forums

Pagination not working in custom post types (1 post)

  1. Rommel
    Member
    Posted 3 years ago #

    My pagination not working or not appearing at the bottom.

    Here is my code:

    <?php get_header(); ?>
    	<div id="content-area" class="container clearfix">
        	<div id="left-content" class="fl">
    
            	<?php query_posts(array(
                'post_type' => 'place', // can be custom post type
                'orderby'=> 'menu_order',
                'paged'=>$paged
    
            ));
    
            ?>
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
            	<div id="post-<?php the_ID(); ?>" class="post-container clearfix">
                	<div class="context-margin">
                        <div class="post-container-headings clearfix">
                            <div class="placeheading fl">
                            	<?php $places_categories = wp_get_object_terms( get_the_ID(), 'places_category');
    							if($places_categories){
    								$pcat = array();
    								foreach($places_categories as $c){
    									$pcat[] = $c->name;
    								}
    								echo implode(', ',$pcat);
    							} ?>
                            </div>
                            <!--//end place heading-->
                            <div class="social-icons fr">
                                <ul>
    								<?php if ( get_post_meta($post->ID, 'twitter', true) ) : ?>
                                    <li><a target="_blank" href="<?php echo get_post_meta($post->ID, 'twitter', true) ?>"><img alt="social" src="<?php echo THEME_URI; ?>/images/twitter-icon.jpg" /></a></li>
                                    <?php endif; ?>
                                    <?php if ( get_post_meta($post->ID, 'facebook', true) ) : ?>
                                    <li><a target="_blank" href="<?php echo get_post_meta($post->ID, 'facebook', true) ?>"><img alt="social" src="<?php echo THEME_URI; ?>/images/fb-icon.jpg" /></a></li>
                                    <?php endif; ?>
                                    <?php if ( get_post_meta($post->ID, 'digg', true) ) : ?>
                                    <li><a target="_blank" href="<?php echo get_post_meta($post->ID, 'digg', true) ?>"><img alt="social" src="<?php echo THEME_URI; ?>/images/di-icon.jpg" /></a></li>
                                    <?php endif; ?>
                                    <?php if ( get_post_meta($post->ID, 'su', true) ) : ?>
                                    <li><a target="_blank" href="<?php echo get_post_meta($post->ID, 'su', true) ?>"><img alt="social" src="<?php echo THEME_URI; ?>/images/su-icon.jpg" /></a></li>
                                    <?php endif; ?>
                                </ul>
                            </div>
                            <!--//end social icons-->
                        </div>
                        <!--//end post container headings-->
                    </div>
                    <!--//end context margin-->
                    <div class="line-separator"></div>
    
                    <div class="blog-start context-margin clearfix">
                    	<div class="blog-title"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></div>
                        <div class="postmeta">Posted in <?php the_time('F jS, Y') ?> | <?php the_author() ?> |
                        		<?php $places_categories = wp_get_object_terms( get_the_ID(), 'places_category');
    							if($places_categories){
    								$pcat = array();
    								foreach($places_categories as $c){
    									$pcat[] = $c->name;
    								}
    								echo implode(', ',$pcat);
    							} ?>
                        </div>
                        <!--//end post meta-->
    
                        <div class="post-entry">
                        	<center>
                        		<?php the_post_thumbnail('main-featured-image'); ?>
                            </center>
    
                            <?php if ( get_post_meta($post->ID, 'video', true) ) : ?>
                            <div class="video-embed">
                            	<?php echo get_post_meta($post->ID, 'video', true) ?>
    
                            </div>
                            <?php endif; ?>
                            <!--//end video embed-->
                           	<?php the_content(); ?>
                        </div>
                        <!--//end post entry-->
    
                        <div class="post-ratings"><?php if(function_exists('the_ratings')) { the_ratings(); } ?></div>
                        <div class="post-features-below clearfix">
    
                            <!--//end remove post-->
    
                            <!--//end follow features-->
                            <div class="comment-counts fr">
                            	<?php comments_popup_link('0 comments', '1 comment', '% Comments', 'comments-link', ''); ?>
                            </div>
                            <!--//end commment counts-->
                        </div>
                        <!--//end post features-->
                    </div>
                    <!--//end blog start/context margin-->
    
                </div>
                <!--//end post container-->
                <?php if ( get_post_meta($post->ID, 'postbanner', true) ) : ?>
                <div class="post-banner"><img alt="post banner" src="<?php echo get_post_meta($post->ID, 'postbanner', true) ?>" /></div>
                <?php endif; ?>
    
                <?php endwhile; endif; wp_reset_query();?>
                <!--//end post loop-->
    
                <div class="clear"></div>
    
                <?php include (TEMPLATEPATH . '/inc/paginations.php' ); ?>
                <!--//end pagination-->
            </div>
            <!--//end left content-->
    
            <div id="right-content" class="fr">
            	<?php get_sidebar(); ?>
            </div>
            <!--//end right content-->
        </div>
        <!--//end content area-->
    
        <div class="clear"></div>
    <?php get_footer(); ?>

    and this is my paginations.php:

    <div class="pagination-bg clearfix">
    	<div class="next-prev fr clearfix">
    
        	<div class="prev fl"><?php previous_posts_link('Previous') ?></div>
            <div class="next fr"><?php next_posts_link('Next') ?></div>
    
       	</div>
        <!--//end next prev-->
    
        <div class="clear"></div>
        <?php kriesi_pagination($additional_loop->max_num_pages); ?>
      	<!--//end paginations lists-->
    </div>

    Please help :(

    Thanks in advance!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags