WordPress.org

Support

Support » How-To and Troubleshooting » Pagination outside the loop from front-page template

Pagination outside the loop from front-page template

Viewing 3 replies - 1 through 3 (of 3 total)
  • Here the first loop
    And the second and third
    Sorry for the abuse of code lines 😛

    In the third loop add in the argumants, ‘paged’ => $paged,

    HTH

    David

    Hi David,

    Don´t work 🙁 may be I´m doing something wrong, this is how I add the paged arguments.

    // Get the page as an Object
    					$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    					$orecent_args = array(
    						'posts_per_page' => 4,
    						'offset' => 4,
    						'post__not_in'  => get_option( 'sticky_posts' ),
    						'public' => true,
    						'ignore_sticky_posts' => 1,
    						'post_type' => 'post',
    						'paged' => $paged
    					);
    
    					// Our new query for the Recent Posts section.
    					$orecent = new WP_Query( $orecent_args );
    
    					// For all other recent posts, just display the title and comment status.
    					while ( $orecent->have_posts() ) : $orecent->the_post(); ?>
    
    						<li class="entry-title">
    							<h4><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'lonchpress' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h4>
    							<!--<span class="comments-link">
    								<?php comments_popup_link( '<span class="leave-reply">' . __( 'Deja un comentario', 'lonchpress' ) . '</span>', __( '1 comentario', 'lonchpress' ), __( '% Comentario', 'lonchpress' ) ); ?>
    							</span>-->
    						</li>
    					<?php
    					endwhile;
    					// If we had some posts, close the <ul>
    					if ( $recent->post_count > 0 )
    						echo '</ul>';
    					?>
    					<?php Lonchpress_content_nav( 'nav-below' ); ?>

    Thanx for the help 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Pagination outside the loop from front-page template’ is closed to new replies.
Skip to toolbar