Pagination is somewhat working on frontpage, doesn’t update when “prev” is clicked

I suspect your problem is here: ‘base’ => get_pagenum_link(1) . ‘%_%’ You’re passing 1 to get_pagenum_link(), rather than the actual page number. Try passing your previously determined $current_page instead: ‘base’ => get_pagenum_link( $current_page ) . ‘%_%’ Note, I use this as base: ‘base’ => @add_query_arg(‘paged’,’%#%’) Edit I tried your suggestion as well as the ‘@add_query_arg’ … Read more

Placing Ads after every 10th Post with Infinite Scroll

See this: http://infiniteajaxscroll.com/docs/events.html#rendered So, place all the ad code in an ajax function (http://codex.wordpress.org/Plugin_API/Action_Reference/wp_ajax_%28action%29) add_action( ‘wp_ajax_your_ad_fn’, ‘your_ad_fn’); add_action( ‘wp_ajax_nopriv_your_ad_fn’, ‘your_ad_fn’); function your_ad_fn(){ // your ad code here // if sending js, set Content-type header to application/javascript // if sending html, text/html } https://stackoverflow.com/questions/9664282/difference-between-application-x-javascript-and-text-javascript-content-types Then in your custom js, ias.on(‘rendered’, function(items) { var $items = $(items); … Read more

Pagination stops at page 6

Trying to use pagination from a different query is always fraught with potential disaster. next_posts_link accepts a second argument, $max_pages, which may solve your issue if you pass it properly: next_posts_link( __( ‘Next’), $idxloop->max_num_pages ); However, the real answer to this question is to adjust your query before the template. Adjusting the default query via … Read more

Custom Post Type Pagination & duplicate posts

I think the best way to implement this is to use pre_get_posts hook. Take a look at this code function customize_query( $query ) { $post = get_posts(array( ‘post_type’ => ‘projects’, ‘taxonomy’ => ‘featured’, ‘numberposts’ => 1 )); if ( $query->is_home() && $query->is_main_query() ) { $query->set( ‘post_type’, ‘projects’ ); $query->set( ‘posts_per_page’, 6 ); if($post && !empty($post)) … Read more

Pagination problem after WP_Query with tag filtering

Finally I’ve figured out the correct coding for this problem: <?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $wp_query = new WP_Query(); $wp_query->query(‘tag=concurs&posts_per_page=”.get_option(“posts_per_page’).’&paged=’ . $paged); ?> <?php if ($wp_query->have_posts()) : ?> <?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?> [code for title, author, category, meta-info etc] <?php endwhile; ?> <div class=”next-prev”><?php posts_nav_link( ‘ ‘, ‘<img … Read more

Paginate Child Pages Content on Parent Page

After some searching I was able to find this post: http://wordpress.org/support/topic/add-pagination-to-list-of-child-pages My final code looks like this: <?php $ids = array(); $pages = get_pages(“child_of=”.$post->ID); if ($pages) { foreach ($pages as $page) { $ids[] = $page->ID; } } $paged = (get_query_var(“paged”)) ? get_query_var(“paged”) : 1; $args = array( “paged” => $paged, “post__in” => $ids, “posts_per_page” => … Read more

Pagination on Custom Post Type: 404 Error

While pre_get_posts is a much better solution for modifying the parameters for the archive main query for specific conditions like Custom Post Types, as Milo and helgatheviking mentioned, trying to use a custom query to override the main query for an archive is overcomplicating the issue. Since I’m building a custom Tumblr like gallery template … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)