Questions tagged [pagination]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
2k views

Paginated pages are showing correct content but pagination links are not

I am using a custom WP_Query to display posts on static front page. and generating numbered pagination links with paginate_links functions. This is the code I have... $latest_args = array( '...
Robert hue's user avatar
  • 8,466
1 vote
2 answers
4k views

How to ignore or disable nextpage tag?

I have this site that uses the <!--nextpage--> tag in posts for pagination purposes. I want to disable pagination, but without deleting the tags for the database (maybe they'll want to use them ...
lucian's user avatar
  • 312
1 vote
1 answer
984 views

Help With A Reverse Pagination Plugin

I saw this presentation about why pagination on the Internet is weird. https://speakerdeck.com/u/espylaub/p/pagination-on-the-internet-and-why-its-weird It inspired me to try and make a WordPress ...
kingkool68's user avatar
  • 1,219
1 vote
3 answers
7k views

Custom page-links for paginated posts | wp_link_pages <!--nextpage--> quicktag

Does anyone know if it's possible to change wp_link_pages, so that the title of each nextpage quicktag is used rather than numbers? I can't seem to find anything on this. This is an example of how I'...
sta777's user avatar
  • 335
1 vote
1 answer
4k views

pagination in woocommerce order history page

Please help me to add pagination in my order history page. Pagination should work like WooCommerce products page. Here is my code: <?php $customer_orders = get_posts( apply_filters( '...
priya's user avatar
  • 21
0 votes
1 answer
52 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
2 answers
3k views

paginate function in archive for custom-post-type

I have a custom-post-type for events and use the normal archive.php template to list all previous events. The thing is that I use a custom query for my event-post-type inside archive.php like this … ...
mathiregister's user avatar
0 votes
1 answer
1k views

How to create pagination on archive.php template

I'm creating a custom theme and I'm struggling to get pagination working on my archive.php template. I've tried to adapt the code I'm using on my main blog page, but it's simply displaying all blog ...
Tom Perkins's user avatar
0 votes
1 answer
764 views

Injecting content with $wp_query->current_post restarts from zero on paged pages. How to inject content after X posts, regardless of pagination?

I am creating a shortcode that outputs a custom loop. Within the loop while, I am injecting certain content after a particular post count. This is done by checking the current_post number. This ...
Garconis's user avatar
  • 144
0 votes
1 answer
284 views

How to grab a specific page of content from paginated post?

In my case I've got to create articles where each article has a custom, unchanging "header" part far too rich for the title and the excerpt (it's to contain image, media etc), and then a few different ...
SF.'s user avatar
  • 127
0 votes
1 answer
116 views

Custom Taxonomy terms with latest post ordered by date pagination issue

I'm using the similar code from this question, order terms by post date works only if I display all the terms on the page, example terms_to_display = 99999, but if I set it to 6 or for example, the ...
Darko's user avatar
  • 146
0 votes
2 answers
14k views

Pagination wont work with search results template [duplicate]

I can't seem to get pagination to work correctly in my search results template. The page links appear, but when i click onto page 2, it gives me a 404 error. Search.php <?php global $wp_query; $...
RoseCoder's user avatar
  • 181
0 votes
1 answer
2k views

Show single post then all posts (with pagination)

On my single.php I would like to show the single post then list all the posts with a pagination. I use the following code: <?php while ( have_posts() ) : the_post(); ?> <!-- Show single ...
jjj's user avatar
  • 119
0 votes
2 answers
2k views

how could I get the pagination as I want to when query posts using get_posts function

I am using WP3.5, and I have a post_list.php which will show all the posts order by post date DESC. Everything is ok except pagination. I have 15 posts, for test purpose, I want to every page show 2 ...
diligent's user avatar
  • 289
0 votes
2 answers
3k views

Pagenavi pagination via wp-query in functions.php showing same content for each page

I've recently had a lot of help creating an upcoming events list (see here Showing upcoming events including todays event - StackOverflow), as a result my pagination using wp_pagenavi() is broken. At ...
Rob's user avatar
  • 1,406
0 votes
1 answer
2k views

WP_Query pagination using only numbers instead of /page/1 on URL

I don't get whats happening here. I'm on a child-page template, generating a WP_Query for Custom Post Types on the fly, like this: $notrel = new WP_Query(array( 'post_type' => $type, '...
moraleida's user avatar
  • 2,245
0 votes
1 answer
345 views

category/category_name pagination 404 error

<div class="row"> <?php $currCat = get_category(get_query_var('cat')); $cat_name = $currCat->name; $cat_id = get_cat_ID( $cat_name ); $paged = (get_query_var('paged')) ...
erzen's user avatar
  • 103
0 votes
1 answer
769 views

Changing Link Attributes for Wp_Link_Pages

I'm wondering if there is any way to change the actual link itself for wp_link_pages. So right now, I have a simple code to display the pagination for a post, it looks like this: <?php ...
user1936894's user avatar
0 votes
3 answers
10k views

Query with pre_get_posts to get pagination

After pretty much getting everything working with query_posts, I noticed my pagination wasn't running. I was told pre_get_posts should be the solution. My problems: I don't know how to pass all my ...
WouterB's user avatar
  • 357
0 votes
1 answer
1k views

Pagination problem in custom post type used as front page

I am working on a theme with custom post type. the issue currently is that i am saving the layout files in a folder called templates.. and in front-page.php i am using an options check to see which ...
Ayaz Malik's user avatar
0 votes
1 answer
4k views

Pagination with get_posts seems to work but links not showing

I've a custom page template where I want to query 2 posts from a post type and 1 post from another post type. I have it set up like this: $paged = get_query_var('paged') ? get_query_var('paged') : 1; ...
elclanrs's user avatar
  • 233
0 votes
1 answer
185 views

How can i call an article from each category and still paginate properly?

I want to have my front page, with three columns, each assigned to a different category. Ideally I would like to query to fetch one post, per column, per page where possible, leaving the column empty ...
Mild Fuzz's user avatar
  • 4,170
0 votes
1 answer
3k views

pagenavigation not showing the next page just linking back to the main page [closed]

Using this on my index.php <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?> Using plugin: WP-PageNavi Wp Pagenavi Style Not sure what information you need to help me fix this. ...
bran's user avatar
  • 177
0 votes
2 answers
1k views

Fix custom query pagination without changing site-wide posts-per-page settings

Many people report problems with pagination of custom queries or custom post type archives: url/page/2 produces a 404 even though all the setup is correct. Many end up figuring out that this is ...
supertrue's user avatar
  • 3,016
0 votes
1 answer
2k views

posts_nav_link on single post template

I have a post type called journal and on the single-journal.php template I am querying the rest of the journal posts like so: <?php query_posts( array( 'posts_per_page' => 4, '...
user1374796's user avatar
0 votes
3 answers
7k views

Show number of posts AND number on current page

I know how to show the total number of posts in a site, but is there a way to show the number of posts the page you're on is displaying? For example, I want to show this at the bottom of each of my ...
Dean Elliott's user avatar
0 votes
2 answers
1k views

Pagination Not working on Home Page with 2 Query

I have two loops in home page (index.php) <?php $args = array( 'post_type' => 'post', 'posts_per_page' => 3, ); $another_query = new WP_Query($args); if( $...
user avatar
0 votes
1 answer
739 views

Pagination on child category returns 404

Can anyone figure out why viewing pages in my child categories results in a 404, when the same $paged code works fine for my index file? This is inside of my category-15.php (it's to affect all child ...
Arkuen's user avatar
  • 63
0 votes
1 answer
2k views

pagination in author.php template returns 404 error

Hi to the community!!! I need some help with pagination in author.php template. I have pagination working in all my loops except in authors.php that i get a 404 error. In my settings/reading i have ...
Philip's user avatar
  • 2,019
0 votes
3 answers
13k views

Pagination not working on Custom Page Template

I searched a lot on this but I can't figure out why my code is not working. I published a page with slug "blog" that uses a custom built template "page-blog.php" that I build from ...
bluantinoo's user avatar
0 votes
1 answer
2k views

Listing child terms of parent term

I'm using the following code to generate a list of only the child terms within my taxonomy. What I'd also like to do is display a list of the child terms for each parent category on a taxonomy-mytax-...
streetfire's user avatar
0 votes
1 answer
2k views

Custom Permalinks Break Search Pagination

So I'm having a weird issue that I've never seen. I have a search.php set up like this: $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts($query_string . '&paged=' . $...
Pippin's user avatar
  • 4,886
0 votes
1 answer
127 views

Display "Post 2 of 4" on single post page?

I have a custom post type called Projects. When viewing a single 'project' post I have next/prev buttons to navigate through them. I also want to display text saying "Project 2 of 4" or ideally ...
fxfuture's user avatar
  • 1,337
0 votes
2 answers
202 views

Show posts of one category only with Custom Taxonomy on single.php

I have created a custom post type named 14kgold. Under this I defined two categories: Symphony and Noir. Now I added items/ products to each category. When I open a product under one category i.e. ...
Disha's user avatar
  • 21
0 votes
3 answers
6k views

Pagination that includes "view all on one page"

I'm using the code below to create pagination for my post results, it works fine but is it possible to add a "view all posts on one page" button to the pagination? This would presumably override ...
maikunari's user avatar
  • 165
0 votes
2 answers
6k views

Pagination not working for category posts

I am using WP-PageNavi pagination and because of certain reasons I have "Blog pages show at most" set to 100 and I can't reduce it. I have a total of 30 posts in a category. I want to display 10 ...
Hussain Ansari's user avatar
0 votes
0 answers
178 views

Pagination not working Search posts

if ( have_posts() ) { while ( have_posts() ) { the_post(); global $post; //loop here } if(function_exists('wp_pagenavi')) { wp_pagenavi(); } } I have the following code in function ...
Hussain Ansari's user avatar
0 votes
0 answers
711 views

Archive pagination causing 404 with permalinks structure

Somehow my archive.php is causing some problems because I'm using /%category%/%postname%/ as my permalink structure. The next_posts_link() redirects to /category/page/2: which causes an 404 error. ...
ronnyrr's user avatar
  • 373
0 votes
3 answers
791 views

Paginate get related post by author function

Is it possible to get this function paged? I've tried to add previous and next links but i'ts not working... function get_related_author_posts() { global $authordata, $post; ...
bpy's user avatar
  • 299
0 votes
1 answer
53k views

Creating a simple pagination for custom post type templates

I have custom post post type call 'news' and I am struggling to get it to paginate correctly. I'm looking for a simple prev and next links, not worried about page numbers in the middle. In page-news....
Jack Barham's user avatar
0 votes
2 answers
2k views

Is there a PHP function that can match anything after the given URL, so my IF statement will work in each instance?

I have an IF statement shown below that runs one of 2 custom queries, based on the url. The problem I'm facing is if the url contains pagination such as /page/2/, my query breaks because the url isn't ...
Andrew's user avatar
  • 1,163
0 votes
1 answer
1k views

Pagination & get_pages?

I have a page that list the child pages of this specifiec page but i would like to add pagination for it , how can i do this ? here is the code that get's the pages <ul id="products" class="items-...
ahmedelgabri's user avatar
0 votes
2 answers
657 views

Custom Loop Pagination on WordPress

I'm trying to create a magazine style website. For this particular page (not homepage) I'd like to fetch the latest post and style it one way (style1). For all the other posts I'd like to just display ...
gromey's user avatar
  • 1
0 votes
1 answer
4k views

How to use pre_get_posts?

I am having a problem with the custom category template pagination and i search and read that using pre_get_posts fix the pagination problem. I read the pre_get_posts information in the WordPress ...
Charitos's user avatar
0 votes
1 answer
3k views

custom post type paging not working past page 3

I have a custom post type called services which has 23 custom posts, i also have a custom taxonomy for all the categories (5 categories). I am trying to create a list of all the custom posts of ...
asaunders's user avatar
  • 251
0 votes
1 answer
139 views

Broken pagination, need help figuring out why!

I just tried slapping together a poor-man's "featured post" section with this exact code out of my index.php: <div id="post-wrapper"> <?php if (is_home() && !is_paged()) : ?> ...
user avatar
0 votes
2 answers
4k views

Possible to paginate on single.php?

I know this sounds illogical and maybe it is, but the client's asked for it so I'm looking into a solution if possible. On a section of the site there's a link that leads to category-news.php, which ...
Staffan Estberg's user avatar
0 votes
2 answers
917 views

Custom Post Type, Two categories, Two columns with Pagination

I searching a lot to found a way solves that and no luck at least. Sorry for my unpulish english, I do my best explaining my issue. I have a Custom Post Type called 'Events' this have two categories ...
bevi's user avatar
  • 19
0 votes
2 answers
1k views

Custom Taxonomy archive returns 404

I made custom post type with one taxonomy. Everything was good except pagination on taxonomy. Firstly, without any changes, I was able to switch pages on main custom post type archive: website.com/...
kaska3er's user avatar
0 votes
1 answer
785 views

Display different number of posts from one category on the different pages

according with Pagination with custom loop. I use the custom loop for display flash game. For make a pagination on the page with posts from one category (mydomain/category/categoryName) I used: ...
glazsasha's user avatar
  • 101