Forum Replies Created
Viewing 2 posts - 1 through 2 (of 2 total)
-
AuthorPosts
-
October 10, 2016 at 10:20 pm in reply to: Pagination on Homepage (Index Page) with Foodie Pro Theme #194486
[email protected]
MemberMy brain is fried, I'm really at a loss here. I get that there's no loop on front-page.php, okay so I have tried to create my own. I have all my widgets set to display a total 4 posts from category id 5 on the homepage. I want pagination links to go to a page that will show the next 4 pages and so on. How do I create a loop to do that. Right now it's just showing a listing of all my published posts when I click the next page link. Here's the end of my front-page.php
genesis_widget_area( 'home-bottom', array( 'before' => '<div class="widget-area home-bottom">', 'after' => '</div> <!-- end .home-bottom --> <div class="pagination">' . paginate_links( array( 'prev_text' => __('« Previous Page'), 'next_text' => __('Next Page »') ) ) . '</div>' ) ); // Based on https://gist.github.com/billerickson/3218052 global $post; // arguments, adjust as needed $args = array( // 'post_type' => 'post', 'category' => '5', 'posts_per_page' => get_option( 'posts_per_page' ), // 'post_status' => 'publish', 'paged' => get_query_var( 'paged' ) ); /* Overwrite $wp_query with our new query. The only reason we're doing this is so the pagination functions work, since they use $wp_query. If pagination wasn't an issue, use: https://gist.github.com/3218106 */ global $wp_query; $wp_query = new WP_Query( $args ); if ( have_posts() ) : while ( have_posts() ) : the_post(); endwhile; do_action( 'genesis_after_endwhile' ); endif; wp_reset_query(); } genesis();
September 12, 2016 at 5:08 pm in reply to: Pagination on Homepage (Index Page) with Foodie Pro Theme #193049[email protected]
MemberI figured it out. To the front-page.php file of the Foodie Pro theme I modified the last couple lines:
genesis_widget_area( 'home-bottom', array( 'before' => '<div class="widget-area home-bottom">', 'after' => '</div> <!-- end .home-bottom -->' . paginate_links( array( 'prev_text' => __('« Previous Page'), 'next_text' => __('Next Page »') ) ) ) ); } genesis();
-
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)