Multiple WP_Query loops with Pagination

Yes, it can be done. The key is to make the format parameter different for the two queries: <!– Cats –> <div class=”animals”> <? $paged1 = isset( $_GET[‘paged1’] ) ? (int) $_GET[‘paged1’] : 1; $paged2 = isset( $_GET[‘paged2’] ) ? (int) $_GET[‘paged2’] : 1; // Custom Loop with Pagination 1 // http://codex.wordpress.org/Class_Reference/WP_Query#Usage $args1 = array( … Read more

Why is “/page/2/” not working?

Found the answer: After a looong day debugging thru wordpress core, I managed to solve this issue. Basicly, you CANT have a PAGE and a CUSTOM POST TYPE with the same name. If you do, the permalink rewrite rules will get confused and trigger a 404. A very simple solution I’m using is: The page … Read more

Get the current page URL (including pagination)

In addition to Rajeev Vyas’s answer, you don’t need to pass any non-empty parameters to add_query_arg(). The following has always worked well for me: // relative current URI: $current_rel_uri = add_query_arg( NULL, NULL ); // absolute current URI (on single site): $current_uri = home_url( add_query_arg( NULL, NULL ) ); The function falls back on $_SERVER[ … Read more

Why do you need an unlikely integer in paginating?

Note the get_pagenum_link( $big ): This will create an URL (not a link) based on the number provided in the first parameter. That function is used to get the basic pattern for the URL, and the high integer is used here, because: You must provide an integer as argument. The resulting URL is filtered with … Read more

Paged posts – how to use numbers and next/previous links?

The function you’re using, wp_link_pages­Codex, does not have the feature you’re looking for by default. However you can easily extend it by using a callback function, registered as a filter on that functions arguments: add_filter(‘wp_link_pages_args’, ‘wp_link_pages_args_prevnext_add’); The filter will then modify the parameters that are used in that function on-the-fly and inject the missing links … Read more

Change Posts per page count

This will do it: (add to your theme’s functions.php) add_action( ‘pre_get_posts’, ‘set_posts_per_page’ ); function set_posts_per_page( $query ) { global $wp_the_query; if ( ( ! is_admin() ) && ( $query === $wp_the_query ) && ( $query->is_search() ) ) { $query->set( ‘posts_per_page’, 3 ); } elseif ( ( ! is_admin() ) && ( $query === $wp_the_query ) … Read more

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