Questions tagged [pagination]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
8 views

Issues with Ajax Pagination and Filtering

I am creating a website and just can't manage to get the pagination to update when a filter is selected. block.php <section class="photographers full-width-grid mt-<?= $attributes['margin-...
Patrick's user avatar
1 vote
0 answers
17 views

Custom post type sub-category pagination return error 404 on second page

I have a custom query as follows: $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'post_type' => 'programme', 'posts_per_page' =&...
Azman Ishak's user avatar
0 votes
0 answers
29 views

Trying to create a cutom query with pagination and page 2 breaking. Any help?

This is what I have tried so far: <?php /* Template Name: Archive-posts */ ?> <?php get_header(); ?> <main id="primary" class="site-main"> <div class=&...
Ivan Bezerra's user avatar
0 votes
0 answers
9 views

Trying to create wordpress pagination and breaking while live [duplicate]

I have been coding a pagination for my WordPress site, for a custom post query. and while it works just fine in my local machine it breaks online. I get a 404 when trying to click on page 2, while ...
Ivan Bezerra's user avatar
0 votes
1 answer
53 views

Custom post type pagination not working in index.php file

I have created a custom post type called news Here is the code function create_post_type_news() { $supports = array( 'title', // post title 'editor', // post content 'author', // post author '...
Vivek Saha's user avatar
0 votes
1 answer
66 views

Custom post type category pages pagination returns 404

I currently have the main posts archive page at /blog/ (custom permalink structure of /blog/%postname%/) and categories at /blog/category/ (categories base left empty so it defaults to this). I have a ...
ajs_app's user avatar
  • 15
0 votes
1 answer
40 views

Stop the_posts_pagination() from passing on any url parameters?

I am using the_posts_pagination() on my native archive pages and paginate_links() on some pages with custom queries. However, the function seems to pass on any url parameters from the current page. If ...
vividog3873's user avatar
0 votes
2 answers
40 views

Why aren't all my posts retrieving?

I am trying to create a small custom snippet of code to generate a query of posts on my website. I use the plugin Advanced Custom Fields (ACF) to tag the country of origin on to posts on the website. ...
Rach's user avatar
  • 1
0 votes
1 answer
27 views

Parameter for pagination posts_pagination

I created a pagination with the_posts_pagination() function Right now it looks like this and it works fine: Previous 1 2 3 4 Next When I am on the 1st page, the "prev" button disappears or &...
Thica's user avatar
  • 17
0 votes
1 answer
43 views

Query Multiple Post Types and Paginate Newly Created List

I know this has be asked several times but i cant seem to find the answer anywhere. My site has a resources page which is my archive for all resources (archive-resources.php). I'm trying to also ...
user2402492's user avatar
0 votes
0 answers
55 views

Multiple WP_Query with pagination shows Page/2 content on the remaining pages

I have gone through many articles and scrolled through almost all the questions here but couldn't resolve my issue. So I'll explain my scenario in detail My index.php looks like this which segregates ...
user3362364's user avatar
0 votes
1 answer
61 views

Multiple queries and pagination

I have a homepage and an archive page where I call a template part to have a hero section for the most recent posts, and then loop through the remaining posts as usual. Essentially I don't want to ...
lastnoob's user avatar
  • 153
0 votes
0 answers
35 views

Woocommerce paginate link generates #038 instead of ? - seems connected to caching

If I don't reset my cache before using the shop page, #038 appears in the URLs generated in the pagination links at the bottom of the page, and the pagination doesn't work (stays on the same first ...
Resh's user avatar
  • 1
0 votes
1 answer
181 views

posts_results filter - additional sort, with a meta value, to move posts to the end of the results, with pagination working

I have a custom post type for business locations that I am trying to add an additional sorting filter to by using a custom meta value. The custom field specifies whether or not the location is open or ...
user13286's user avatar
  • 255
0 votes
0 answers
20 views

Pagination Links for Custom post type returns 404 [duplicate]

first of all, I am new to WP development, and PHP. I am developing a template that has several custom post types. the problem is when I add pagination to my custom post type, all pagination links ...
Ehsan Aliverdi's user avatar
0 votes
0 answers
68 views

WP Category Archive /page/2+ pagination issue 404

Encountered an issue when navigating to archive pages within a category after page 1 of the results via pagination. This is the standard WP categories and not a custom query. Working: /category/...
ejay's user avatar
  • 1
0 votes
1 answer
38 views

Pagination with WP_query giving same items in each page

I have around 250+ blog posts and currently in my custom theme I've implemented the functionality of showing the blogs with pagination option. But in all pages it is showing the same posts. <?php $...
buzz's user avatar
  • 101
1 vote
0 answers
427 views

Wordpress Custom Post Type Archive, filter by category and get pagination working

I have created 9 different Custom Post Types via ACF and an assortment of custom field blocks for 8 of them. Those 8 are used to create different content, based on requirements for each post type. The ...
Mitch S's user avatar
  • 27
0 votes
0 answers
21 views

Bulk 301 redirect for Taxonomies with pagination

I'm looking for the best way to bulk redirect for modified taxonomy URLs. After category slug has been changed, I need to perform a redirect for all paginated pages: /category-old/ redirects to /...
Alexius The Coder's user avatar
0 votes
0 answers
23 views

Create an archive page by combining two post type

I wanna create an archive page for both normal posts and a custom post type(gallery). I created an index.php file and put my code in there but its pagination ain't work correctly. all pages look the ...
Poorya Ghorbani's user avatar
0 votes
0 answers
63 views

Add pagination to a page with sections

I have on my website, on a specific page (library), several vertically arranged sections. The problem is that there are too many (they look like posts, but they aren't). (I create and edit these ...
EDG_DGK's user avatar
0 votes
0 answers
21 views

Pagination works only on index.php and not archive pages

I have a pagination function which i intend using for all pagination on my wordpress blog, but the function doesn't work on archive.php, category-music.php and other archive pages, while it works ...
Sarah Douglas's user avatar
0 votes
0 answers
93 views

Why WordPress custom php code for pagination cannot go to next page

Link before I click search: https://nama-sistem.com/carian/ Link after I click search (by name, month, year, theme): https://nama-sistem.com/carian/?nama=abx&month=july&years=2022&theme=...
beginner's user avatar
0 votes
0 answers
20 views

Wordpress custom post type listing not showing the correct number of items & pagination

I'm using Custom Post Type UI plugin by WebDevStudios to create custom post type. However, in the admin view custom post type listing, its not showing the correct number of items & also not ...
AdamR's user avatar
  • 1
0 votes
0 answers
44 views

How to always show Prev/Next links, inside pagination pattern?

WordPress full site editing. How to always display the “prev page” & “next page”, in the pagination? Currently, the prev-page/next-page, hides when there's no prev/next posts in the query loop. Is ...
neoswf's user avatar
  • 125
0 votes
0 answers
277 views

Load more posts button and pagination at the same time

I need to have a button - load more posts - and pagination at the same time - first the button and pagination below it. I think the better way to do it is via admin-ajax.php. I can do one or the other ...
Brgerg30879's user avatar
0 votes
1 answer
17 views

How to display paginated posts from all categories?

I found this code that helps to paginate the posts of one specific category, how can I change it to have a posts paginate function for all categories? (WordPress) global $wp_query; $result = new ...
Andrea Sacconi's user avatar
0 votes
0 answers
50 views

Pagination count and Pagination link not working in my buddypress template

I am trying to create a letter archive for the users on their buddypress profile page. The letters are displayed in the profile page tab, but the pagination is not working. $contest_args = array( '...
Rohit kc's user avatar
0 votes
1 answer
231 views

My pagination creates a redirect

Can you help me this time to fix this problem my code is: public function numeric_pagination() { global $wp_query , $wp_rewrite;; if ( $wp_query->max_num_pages < 2 ) { ...
Ali Kiani's user avatar
0 votes
0 answers
228 views

How to display pagination for WooCommerce products

I have written this code to display WooCommerce products <div class="products-container container mb-4"> <div class="products-filter-section mt-3"> <?php ...
younes's user avatar
  • 1
0 votes
0 answers
93 views

Pagination with Query String instead of Path

Is it possible to use ?page=2 instead of /page/2 for pagination? When I try and navigate to a url containing ?page=2 the query string is removed from the url before the page loads and although I ...
Cam Parry's user avatar
0 votes
0 answers
23 views

Zeroise custom pagination to have leading 0

I'm trying to have leading 0's in front of my custom pagination and I've seen that I need to use the zeroise function to achieve this. I've tried a few different ways to implement but it just doesn't ...
probablybest's user avatar
0 votes
1 answer
39 views

Search pagination rewrite to fix 404

I'm wondering if anyone can help me out here? Basically, I think I need to use add_rewrite_rule() to get pagination working in my search results, as I've gone beyond the default query due to a bunch ...
Jase Warner's user avatar
0 votes
1 answer
48 views

wordpress category rewrite rule with pagination

with the help of someone here I was able to filter two or more categories via this rewrite rule '^combine/([^/]*)/?([^/]*)/([^/]*)/?','index.php?category_name=$matches[1]+$matches[2]+$matches[3]', '...
inrob's user avatar
  • 103
0 votes
0 answers
198 views

Pagination only showed when no category is set in wp_query

tldr: On my production site only, when I set category_name to any category my pagination does not show up. Once I remove category_name from my wp_query the pagination shows up (for all posts on my ...
james's user avatar
  • 135
1 vote
1 answer
240 views

Why do I get a 404 error on my custom post type archive pagination?

When I try to set up pagination on my custom post type archive page I get a 404 if I click on the next page. The first page works fine. Any idea what I'm doing wrong? <?php get_header(); ?> &...
Lisa's user avatar
  • 13
1 vote
1 answer
158 views

Limit paginated result set to a maximum number of posts

I would like to create a paginated result using a maximum number of posts. I have been trying to achieve this using \WP_Query class e.g: function getQuery(int $page, int $posts_per_page = 2, int $...
Cyclonecode's user avatar
  • 1,154
0 votes
1 answer
52 views

Search results stuck on page 1

The problem statement For some reason when the user does a search the results page (search.php) only show the first page results. The pagination (next and previous links) also believes its on page 1. ...
Mike's user avatar
  • 111
1 vote
0 answers
85 views

How to build custom pagination with center pages

How to build custom pagination in WordPress, which display center pages. For example if there is 100 pagination pages, pagination should look like this - for active page 1: 1 2 3 49 50 51 98 99 ...
dmj5's user avatar
  • 11
0 votes
1 answer
84 views

Why does WordPress keep directing or forcing my pagination?

Why does WordPress keep directing or forcing my pagination? I want my news pagination to work like this: /news/?paged=2 But WordPress keeps forcing it to: /news/page/2/ And then I get a 404 page! ...
Run's user avatar
  • 331
0 votes
0 answers
44 views

Access to a data from a response AJAX called in a template file php

I use an ajax called to get all posts of a custom post type and other criteria. I would like to get the response of my ajax called and use it in a template php file. So my question is : how can I pass ...
davidb45's user avatar
0 votes
0 answers
20 views

CPT Archive Pagination - Page not found

I have the following code to register my CPT, related taxonomy and rewrite rules. $store_name = 'store' add_action('init', function () use ($store_name) { register_post_type( 'my_sample_cpt', ...
Anand's user avatar
  • 1
-1 votes
1 answer
21 views

Insert image between X number of posts but on specific paginated pages?

I'm inserting an image in-between every 5th post using the code below but obviously it shows up on every paginated page. Is there a "pagination" function available to show the image every ...
Nate M.'s user avatar
  • 67
0 votes
1 answer
28 views

Insert multiple custom components after x-number of posts

While there are many posted solutions on how to insert custom components between posts, I haven't been able to find one that addresses pagination. Currently, on my Wordpress archive template, each ...
scottrod's user avatar
  • 101
1 vote
0 answers
26 views

WordPress is adding pagination for all pages not only for blog page, How to remove pagination for all pages except blog/posts page?

You know WordPress is adding pagination for all pages not only for posts page/blog page. For example www.mysite.com, I'm getting URLs like www.mysite.com/page/15, etc. Here, www.mysite.com has a ...
Murali Krishna P's user avatar
0 votes
1 answer
61 views

Pagination not working only on Archive-Name.php using new WP_Query

I created an archive-sticky.php where I added the code below to show all sticky posts in one single page with pagination as there will be 100s of sticky posts in the coming days. Now, this code ...
Elaine Byene's user avatar
0 votes
0 answers
22 views

Separate page for pagination possible?

This is how my index.php looks like for my custom theme (I'm not sure if Line 4-5 is necessary). When I put pagination in the home or post, I would like to be able to take the user to a separate ...
Elaine Byene's user avatar
0 votes
2 answers
63 views

Blog Posts not sorted and pagination not adjusted after filtering some category

Hello im really stuck and messing around now so i thought i give a try and ask the community. Im working on a Blog Post page where im showing some posts. The user have the selection to search for ...
Jaba's user avatar
  • 63
0 votes
0 answers
111 views

add_rewrite_rule pagination 404 error on page 4 and above

I am working on a site using Wordpress 6.0.2. Astra is the theme and I am using Elementor Pro. I have lots of custom post types and taxomonies. I am using add_rewrite_rule like this: add_rewrite_rule( ...
Steve Hoare's user avatar
0 votes
0 answers
32 views

Pagination not working on custom post type archive

The pagination is not working. In settings > reading I have set '3' posts for blog pages show at most. On my custom post type archive page, I have 9 posts showing and I have this code. Not sure ...
Carina's user avatar
  • 1

1
2 3 4 5
37