New answers tagged

0

The base argument for paginate_links() should be: admin_url( 'admin.php?page=lismovim-withdraw-slug&paged=%_%' ) ... where %_% is replaced by format, which should be: '%#%' ... which is replaced by the page number.


0

You should get total and result array separately. Total is to create the page numbers and result array will give you limited data for each pages. Refer the below code. if (isset($_POST['list_position']) && $_POST['list_position'] != 'Select by Position'){ $list_position= $_POST['list_position']; $totalPosition= $wpdb->get_var("SELECT ...


0

I was lucky, the theme used it's own function, so it was easy to override. Inspired by worpdress native get_the_posts_navigation (wp-includes/link-template.php) here is what I end up using: function my_get_the_posts_navigation( $args = array() ) { $limit = 5; $navigation = ''; // Don't print empty markup if there's only one page. if ( ...


0

The Base is the Problem: 'base' => add_query_arg('listpostspage','%#%'), Here ist the full code: $pagination_args = array( 'base' => add_query_arg('listpostspage','%#%'), 'format' => '?listpostspage=%#%', 'total' => $the_query->max_num_pages, 'current' => $paged, 'show_all' ...


0

I have added pagination in order history page and it is working. Replace below code above loop $customer_orders1 = get_posts(apply_filters('woocommerce_my_account_my_orders_query', array( 'numberposts' => -1, 'meta_key' => '_customer_user', 'meta_value' => get_current_user_id(), 'post_type' => wc_get_order_types('view-orders'), ...


0

I have added pagination in order history page and it is working. Replace below code above loop $my_orders_columns = apply_filters( 'woocommerce_my_account_my_orders_columns', array( 'order-number' => __( 'ID', 'woocommerce' ), 'order-date' => __( 'Date', 'woocommerce' ), 'order-total' => __( 'Packages', 'woocommerce' ), ...


1

With is_paged you are testing whether a post has been divided in parts using the QuickTag. But with next_posts_link you are pointing to the next page of posts. So you probably need another test.


-1

Can you please try below code? $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; $woo_home_query = array( 'post_type' => 'product', 'posts_per_page' => $top_selling_products_nr, 'meta_key' => 'total_sales', 'paged' => $paged, 'orderby' => 'meta_value_num' ...


2

Try this in your functions.php file: add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 200, 200 ); Read More: http://codex.wordpress.org/Function_Reference/set_post_thumbnail_size


0

You might want to load all the items on the page at the same time, and use jQuery to display however many at a time. So for example: By default you could load (to the DOM) and hide all of them, then load 4 at a time using jQuery's slice Here's an example for my videos, however you could also hide the previous 4 videos before loading the next 4 to simulate ...


1

You are setting null to $wp_query then querying get_query_var( 'paged' ) this is expected that you will get this error! First query get_query_var( 'paged' ) then set the original $wp_query to null Example:- $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; global $wp_query; $temp = $wp_query; $wp_query = new WP_Query( ...


0

This is a nuts-and-bolts way of getting at this problem. This modifies the SQL query itself, but it's pretty much a 1 liner. I'm sure there are other ways, but this method is not very invasive to the query building process as it only mods the SQL at the end. Note I realize this method could be usurped by the syntax of a query builder at some point. First ...


3

As I far I know, get_posts() function can not be used to paginated results. It is intended to get an array of posts and it sets no_found_rows to true by default from WP 3.1. Pagination won't work unless you set it to false, or better, use WP_Query. numberposts is also a invalid argument. $paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1; ...



Top 50 recent answers are included