pagination functions are not working
pagination functions are not working
pagination functions are not working
EDIT: I didn’t read your code properly, sorry! You’re using get posts which will only retrieve posts. To get all the images from the media library you’ll need to use WP_query. $query_images_args = array( ‘post_type’ => ‘attachment’, ‘post_mime_type’ =>’image’, ‘post_status’ => ‘inherit’, ‘posts_per_page’ => -1, ); $query_images = new WP_Query( $query_images_args ); $images = array(); … Read more
Having same problem. Ended up with the following codes global $woocommerce_loop; $woocommerce_loop[‘paged’] = (isset($woocommerce_loop[‘paged’])) ? $woocommerce_loop[‘paged’] : 1; $woocommerce_loop[‘total’] = $custom_query->found_posts; $woocommerce_loop[‘post_count’] = $custom_query->post_count; $woocommerce_loop[‘per_page’] = $per_page; $woocommerce_loop[‘total_pages’] = ceil($custom_query->found_posts/$per_page); $woocommerce_loop[‘current_page’] = $args[‘paged’];
You can quite easily access current page of paginated post with get_query_var(‘page’), though confusingly it will be 0,2,3… It wouldn’t be hard to do whatever you want with title, conditionally on that. Any modern theme should have title theme feature enabled and have it easily filterable via hooks in wp_get_document_title().
Get current_post in reverse order with pagination
I changed my js to something like this one where I stored current page state for each of the taxonomy-terms and send the current page number back to my call-back function where I queried posts on the basis of that page number. var loading = false; var second_array = []; var count = 1; $(‘body’).on(‘click’, … Read more
This may not be the proper way but it works in BP profile pages … $paged = ( isset( $_GET[‘vp’] ) ) ? $_GET[‘vp’] : 1; $args = array( ‘post_type’ => array( ‘video’ ), ‘author’ => bp_displayed_user_id(), ‘paged’ => $paged, ‘posts_per_page’ => get_option( ‘posts_per_page’ ) ); $author_videos = new WP_Query( $args ); if ( $author_videos->have_posts() … Read more
You Can try this way: add the following before $args if( get_query_var( ‘paged’ ) ): $my_page = get_query_var( ‘paged’ ); else: if( get_query_var( ‘page’ ) ): $my_page = get_query_var( ‘page’ ); else: $my_page = 1; endif; $paged = $my_page; Replace pagination code with this(make sure to add this after endwhile): $total = $projects->found_posts; $page = … Read more
The problem is with your permalinks, try changing to default, not to %postname%. If it still exist let me know further.
wp_link_pages_link filters the entire HTML link (<a href… etc.), which is why what you’ve got isn’t working. There doesn’t appear to be a filter for just the page number, $i, so you’ll need a workaround. Since the callback function for the wp_link_pages_link filter passes the $i, we could use that to find the number inside … Read more