Questions tagged [pagination]

Breaking up content into smaller-sized pages to be viewed individually

Filter by
Sorted by
Tagged with
0
votes
1answer
3k views

How to add Pagination to foreach loop to page

I create a page in wordpress series.php and here it the code where I block! <?php $categories=get_categories( array( 'parent' => $cat->cat_ID) ); ...
2
votes
1answer
682 views

Display post links under month in paginated archive

I'd like to create an archive that lists posts under a month header. The months would just be plain text and the post titles, obviously, would link to the posts themselves! So: October 2013 Post ...
0
votes
0answers
6 views

Method for calculating the offset in order to use array_splice on wpQuery->posts

function getOffset($index, $length, $offset) { $result = 0; $transfer = 0; if ($index + 1 > $length) { return -1; } if ($index + 1 + $offset > $length) { $transfer = $index + 1 ...
0
votes
2answers
739 views

How to limit page pagination… again

I'm digging out on old question as no solution came out. How to limit page pagination I'm looking for a way to limit pages on homepage and categories (archive.php). I have around 200k posts spread ...
0
votes
2answers
90 views

change pagination url

Currently I’m having URL for pagination pages as: http://www.example.com/category_name/page/2 But I need to change this URL structure as: http://www.example.com/category_name/?page=2 etc. any ...
1
vote
0answers
8 views

Changed pagination URLS to use p= instead of paged=

I am trying to rewrite my pagination URLs to use p instead of paged so they go from... example.com/myposts?paged=2 to example.com/myposts?p=2 How is the best way to do this? Do I need to use the ...
1
vote
1answer
23 views

Why is page/2/ not working?

This is my search page code can anyone help me figure out what is the problem I m having no content in my page 2 ...
1
vote
1answer
15 views

Set noindex page-comment from Pages 2, 3 and More?

I use All in one seo pack plugin. I see that Google indexed page comments (that are a pages generated from paginated comments). The example url are the followings: URL canonical - mydomain.com/url-...
0
votes
0answers
12 views

wp_query Pagination is not displaying

I have a basic wp_query that I am trying to apply pagination to like this... $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; $args = array( 'post_type' => '...
0
votes
2answers
2k views

Always show Next and Previous button in wp_link_pages ?

How do we get wp_link_pages() to show the Next and Previous button when it is the start of the multi-page post as well at the end of a multipage. Currently it only shows Next if it is the first page, ...
1
vote
3answers
8k views

Custom post type archive page pagination

I have set up an archive page for my custom post type reference, where I use a query to get all posts of type reference. This works, but when I try to paginate the result, it doesn't work. Right now, ...
0
votes
1answer
821 views

Pagination (on the static front page) shows always the same posts

I have a problem with pagination on my front page. I want to show all posts from a specific category and paginate them. Here is the code if ( is_front_page() ) { $paged = get_query_var( '...
0
votes
0answers
18 views

Why can i add /page/674874 (or any number) to a URL and it still pulls up that page?

I have noticed that on any WordPress site you can add /page/7863/ (or any number) to any page url and it still shows that page and not a 404. Why is that? (Asking because my SEO company sends reports ...
1
vote
1answer
737 views

Sorting Custom Posts on Archive page with pagination

I've got custom taxonomy archive pages with a drop down list that allows users to re-order/sort the posts. It basically waits for the user to select from the drop down then uses array_merge( $wp_query-...
1
vote
0answers
27 views

How can I use var php with javascript to build custom page?

is variable increment in $post_per_page = 10 if click on button next I can increase $Post_per_page = by_call <button type="button" value="increment++" >Increment </button&...
0
votes
5answers
6k views

Pagination on Single Post

I'm looking to set up pagination on my single.php file so I can have my infinite scroll function correctly. I know that pagination can be put on a single post but I somehow need to make the single.php ...
0
votes
1answer
1k views

Pagination url for page template

I am creating a page template in WordPress to show all my posts. But i have a problem with pagination. I have a page url like below: http://localhost/sdd/video "video" is my page slug. And the ...
1
vote
1answer
2k views

Search not showing all results

EDIT: So I've done some troubleshooting and it seems my theme isn't showing woocommerce search results. The 2017 theme does so I am trying to figure out what my theme is missing. I suspect something ...
1
vote
1answer
891 views

Pagination in pages (not posts) with the twentythirteen theme?

I wrote a very long page with a lot of content and would like to add a pagination to make it more readable. I added in the texteditor several <!–-nextpage–-> but it doesn't create any pagination,...
1
vote
2answers
2k views

Archive pagination not working

I am trying to add pagination for my Archive. I want to show 12 posts per page and then show the 'next' / 'previous' buttons. When I manually change the value of the $paged variable, the 1 into a 2 ...
0
votes
2answers
2k views

the_posts_navigation is not working

Unfortunately, the_posts_navigation() function is not working for me. When I click on 'Older Posts' it's showing '404 page I don't know why my code is not working. Here is the code - <div class=...
0
votes
1answer
1k views

Pagination for user list

I am showing all the users by using the get_user() function. But I need to paginate the results. I tried a lot, but didn't succeed. Here is the code, which doesn't work as expected: $args = array( '...
0
votes
1answer
531 views

Added .html to Woocommerce permalink but pagination don't work!

I'm recently added this code to my Wordpress website to add .html for my product category. It worked okay with the category (http://mywebsite.com/parent-category/product-category.html) but when I ...
5
votes
2answers
24k views

Pagination on a WP_query not showing navigation links

I'm having trouble adding pagination to a page. I'm using WP_query and would like to pull back 4 posts per page. The basic query seems to work OK but I must be missing something regarding pagination. ...
0
votes
1answer
10 views

GoBlog Free Pagination Issue

First time poster, my name is Johnny. :) I've built an archive page for my website that I'm very proud of (using Elementor), but I don't want the homepage of this theme to paginate. I want the ...
1
vote
1answer
646 views

Pagination links missing for first link (1) and previous button? How to get pagination links to work?

I'm trying to add pagination to my WordPress query using pagination_links() however I am getting no links returned for my page 1 links and previous link? Other links are adding the paged query string ...
0
votes
1answer
3k views

Using WP_List_Table and search_box(): How to Paginate the Found Search Results When Sending by Method «Post»?

I am using a custom WP_List_Table-Class in order to display a custom table with hotels in the dashboard. I can skip through the pages with the pagination on the top right as expected. The search form ...
0
votes
1answer
3k views

How to list custom post types on a custom post type page?

I would like to know why my custom post type pages do not accept paged pages? On a normal page I can list custom post types without problems, but on a custom post type page, it seems impossible. I ...
0
votes
2answers
798 views

Custom Post Type canonical link / pagination redirecting to root

I have inherited an existing site and have recently been asked to make some changes. They have 'renamed' the default post as 'latest-news' using this 'my_new_default_post_type': <?php add_action(...
1
vote
2answers
87 views

Customize “the_posts_pagination” and put list instead div

Hello everybody, I need help with my custom wordpress pagination. I'm looking to get this : This is what I did : in the functions.php, I've add this code : function wp_custom_pagination($args = [], $...
0
votes
1answer
2k views

Pagination not working in custom loop WP_Query

Please help with pagination I have code that works fine (functions.php) function projects_custom_number_of_posts( $query ) { $query->set( 'posts_per_page', 2 ); return; } add_action( '...
0
votes
1answer
657 views

How to use pre_get_posts to alter posts_per_page of category pages, where 'posts_per_page' will be dynamic

I have Category templates with custom fields in Edit Category page of WordPress. One custom field there is to put How many posts per page to show in the category page. I am using pre_get_posts to ...
0
votes
3answers
2k views

Pagination of custom post type leads to 404 error

This seems to be common issue, and there exist a lot of posts about this issue but none of them works for me. I have a custom post type (portfolio) with a page pagination. $paged = (get_query_var('...
0
votes
0answers
20 views

How to get pagination to work despite naming conflict?

I have been stomped for the past two days trying to understand wordpress' permalink structure. Right now, I have a a custom post type called venue and I have a custom taxonomy venue-type (e.x. hotels, ...
0
votes
1answer
1k views

Custom post type archive pagination with HTML5Blank theme?

Can't get the pagination to work. Here's my archive-work.php: <?php get_header(); ?> <main role="main"> <!-- section --> <section> <h1>&...
0
votes
0answers
20 views

Inject pagination parameters into permalink structure

My goal is to add a parameter to every pagination permalink: domain.com/blog/page/2?pageid=2, domain.com/blog/page/3?pageid=3 in order to tell Google to index all of the above as domain.com/blog/ ...
0
votes
0answers
23 views

Changing posts per page on home page breaks pagination on home only

I'm pretty much a beginner here and have a bug in my website. I have a grid layout of 4 x 4 with a static post as my first one on the home page. It displays on the homepage only using <?php if(...
0
votes
2answers
5k views

How to add pagination to custom page

I am using the loop in my custom page template as you can see in my code. Only 2 posts must be shown and for the rest I should be able to have pagination. <?php $paged = (get_query_var('paged')...
14
votes
8answers
52k views

Get the current page URL (including pagination)

Is there a WP function to automatically get the correct URL of the current page? Meaning if I just opened a single post, the function returns the same as get_permalink(), but if I'm on a paginated ...
0
votes
1answer
2k views

Pagination in custom post type page template

I made a query for my custom post type "websites". I'm trying to get the pagination working but I'm running in some errors. I think the whole code is ok, only the part just before the end while tags. ...
2
votes
2answers
4k views

Pagination with custom post types results in 404 issues

I've a very simple index.php: <div id="content"> <? get_template_part('content', get_post_format()) ?> </div> <div id="pagination"> <? previous_posts_link() ?> &...
1
vote
4answers
541 views

Pagination is not working in custom post type

I want to add pagination in single page of custom post type. This is the code for single page (custom post type): <?php $paged = get_query_var('paged') ? get_query_var('paged') : 1; $args ...
0
votes
2answers
559 views

How to add pagination to a post loop in a custom BuddyPress tab

I created a new tab called "Videos" inside of the BuddyPress Profile page. This tab contains all video posts added by that user. The problem is that it only shows the first 12 posts and the pagination ...
1
vote
0answers
21 views

How to disable redirect on pagination first page

When I pagin to my.site/mypage/page/1 its redirect me to my.site/mypage/, i try to disable it on (template_redirect, do_redirect_guess_404_permalink, redirect_canonical) hooks but it not help here is ...
1
vote
0answers
7 views

Pagination not visible on woocommerce's category page

I am not able to display pagination on the category page on woocommerce, I have 18 products in a category but when I customise the rows and columns, it shows only a certain amount of products. I want ...
0
votes
1answer
632 views

offset and max_num_pages in pagination gallery

I rewrote the code galleries and stopped at the pagination. How can I get the maximum number of pages? at the moment I can not define it, and put a test for the number 5. (Here "for ($ i = 1; $ i &...
0
votes
0answers
15 views

Search results with pagination not working

I've got a news page with a search bar functionality. On this page I want a user to be able to enter a term and the contents of that page will be updated depending on what the user has entered. I don'...
1
vote
1answer
675 views

Pagination in plugin's backend

I am displaying a list of posts in the plugin backend but I can't seem to get the pagination to work. I used the standard approach of getting the "paged" variable and then passing it to get_posts()'s ...
0
votes
1answer
545 views

Pagination on custom post types

Pagination works in the front page but in custom post type page it doesn't appear. Post type: add_action('init', 'portfolio_register'); function portfolio_register() { $args = array( ...
0
votes
0answers
8 views

How to easily exclude first post in pre_get_posts only in queries other than page 1?

In home/category pages (blog), I need to have 4 posts in first page, then 3 posts in all other pages. Problem is, I cannot simply alter posts_per_page, because in following pages I would have wrong ...

1
2 3 4 5
35