WordPress custom URLs for pagination pages

Check the ‘format’ argument <?php $args = array( ‘base’ => ‘%_%’, ‘format’ => ‘?page=%#%’, ‘total’ => 1, ‘current’ => 0, ‘show_all’ => False, ‘end_size’ => 1, ‘mid_size’ => 2, ‘prev_next’ => True, ‘prev_text’ => __(‘« Previous’), ‘next_text’ => __(‘Next »’), ‘type’ => ‘plain’, ‘add_args’ => False, ‘add_fragment’ => ”, ‘before_page_number’ => ”, ‘after_page_number’ => ” … Read more

Skip first post on Category Archive

Have a look at the WordPress Documentation available here, you’ll be able to do what you want to do by using two hooks: https://codex.wordpress.org/Making_Custom_Queries_using_Offset_and_Pagination Unfortunately, many developers find out that hard way that setting an offset value in their custom WordPress queries has the nasty and potentially serious side-effect of breaking pagination. There is a … Read more

WordPress Pagination not working, any ideas?

Hello @lukepnnngtn and welcome! Prepare yourself for reading. Since you’re working on the index.php file we need to consider what’s said in the docs under Removing query_posts from the Main Loop in the Pagination Codex (link): For example, let’s say your theme queries the main loop like this on your home page (index.php) and category … Read more

pagination with sticky posts

I’d suggest using two queries, one for sticky posts, another for all the others. First: query_posts(array(‘post__in’ => get_option(‘sticky_posts’), posts_per_page => 1)); then query all the other posts query_posts( array( ‘post__not_in’ => get_option( ‘sticky_posts’ ), posts_per_page => 7, orderby => date, paged => ‘.$page_to_load.’)); this should do it.

How to implement pagination in backward way eg. first – 20 – 19 – 18 – … – 3 – 2 – 1 – last

You could use wp_paginate_links(), pass it the ‘type’ => ‘array’ parameter in the argument array, and then array_reverse() the output. But: if you’re doing this for SEO purposes, don’t bother. Your canonical URL should be your single-post view, not an archive index; so the index archive page numbers should have minimal SEO impact, no matter … Read more

5 posts per page from single category, paginated

Are you writing a custom query? If so, are you using the paged function in your query? It would look something like this: <?php query_posts( array( ‘posts_per_page’ => 5, ‘cat’ => ’10’, ‘paged’ => ( get_query_var( ‘paged’ ) ? get_query_var( ‘paged’ ) : 1 ), ) ); while( $new_query->have_posts() ) : $new_query->the_post(); ?> // loop … Read more

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

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