Questions tagged [pagination]
Breaking up content into smaller-sized pages to be viewed individually
204
questions
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(
'...
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 ...
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 ...
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'...
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( '...
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
'...
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 …
...
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 ...
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 ...
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 ...
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 ...
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;
$...
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 ...
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 ...
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 ...
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,
'...
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')) ...
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 ...
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 ...
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 ...
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;
...
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 ...
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. ...
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 ...
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,
'...
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 ...
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( $...
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 ...
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 ...
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 ...
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-...
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=' . $...
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 ...
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. ...
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 ...
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 ...
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 ...
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.
...
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;
...
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....
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 ...
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-...
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 ...
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 ...
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 ...
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()) : ?>
...
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 ...
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 ...
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/...
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:
...