Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [paged]

The tag has no usage guidance.

0
votes
0answers
23 views

Custom archive paged head title

My website is in hebrew and when im in a paged archive the title is "archive title" page 2 of 4. How can i add the title only in archives that are in a page 2 or higher? I am using Yoast SEO. And its ...
1
vote
0answers
25 views

Masonry, WP_Query & paged - first page repeating, second page not loading

I'm tearing my hair out over this. I've been tasked with some legacy work on a quite an old site. They have a template for a custom post type called resources. This template has search/filtering ...
0
votes
2answers
1k views

Disable pagination in posts and pages

I need to solve duplicating of posts and pages caused by unexpected paging. I am trying to disable the paging with this function, but it seems I miss something: function wpse_disable_pagination( $...
0
votes
2answers
27 views

div show on home page only not in paged

im using this piece of code to show my div only on homepage. <?php if ( is_front_page() ) :?> but it's shown on pagination 2, 3 and so on. is there any help regarding to fixing this issue?
0
votes
0answers
87 views

Rewrite Rules, Query Vars and Pagination

Putt a lot of research in and did a lot of testing for this issue and I don't think I am going to solve this by myself at this point. What we have: A page with a permalink with one shortcode. That ...
1
vote
1answer
34 views

paged > max_num_pages won't throw 404

I've created new page in WP administration called Blog and created custom page template for it. In the template, I have a simple paged custom query. $query = new WP_Query(array( 'post_type' => '...
0
votes
1answer
55 views

Custom WP_Query always respond with 200 status even when no entry

I'm using a custom WP_Query. The code is something like below: $portfolio_args = array( 'post_type' => 'portfolio', 'posts_per_page' => 5, 'paged' => ...
1
vote
3answers
967 views

Pagination not working on custom query

I am trying to change pages when I search by category on my website. When I am not searching under a certain category I can switch pages fine but when I am searching for a category I am unable to ...
1
vote
0answers
94 views

Shortcode not working with post counter

I am trying to make this a Wordpress shortcode, i mean the below code, but it doesn't seem to work , I included this in my function.php file, but it gave back multiple query result, as seen in the ...
5
votes
1answer
2k views

Get the number of posts from the current page results

I am trying to get the current number of posts that will be present in a page. $wp_query->found_posts will give me the total number of posts in the loop. get_query_var( 'posts_per_page' ) will ...
0
votes
1answer
1k 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 ...
3
votes
2answers
116 views

How can I display 7 posts on the home page, but 9 posts on the subsequent pages?

The home page of my site is set to show the 9 latest posts (via the setting in the admin area), and then at the bottom I have the standard pagination links which allow visitors to view more posts. I ...
0
votes
1answer
38 views

Pagination, query more pages at once

I'm wondering if it is possible to do such thing on Wordpress, I have an infinite scroll to display my posts, I'm keeping track the pages updating the url: mypage.com/news/?pag=3 and I have a code ...
0
votes
0answers
293 views

Pagination diplays always 2 pages

I have a problem with the pagination its working great with blog page, but when i want to show custom post type it shows always two pages even if it contains just one post. P.S. I modified in my ...
8
votes
2answers
1k views

How can I create a category landing page followed by pages of posts?

I'm trying to create a category template in my theme that will display static content if the user is on the first page of the archive, and then display the posts in the category on the following pages....
0
votes
1answer
57 views

Get a link to paged(<!--nextpage-->) part?

I want to get a link (like get_permalink($id) ) to it's specific page of a post (created by <!--nexpage--> tag).. how to achieve this?
3
votes
1answer
114 views

Change page /2 to /transcript with a Rewrite

I set up this rule (in functions.php) function custom_rewrite_basic() { add_rewrite_rule( 'episode/([^/]+)/transcript', 'index.php?post_type=episodes&episodes=$matches[1]&...
2
votes
1answer
6k views

What is the difference between $paged and $page?

I'm creating pagination for my site. Hope everyone can explain to me what below code used for? Thanks in advance. <?php if ( get_query_var('paged') ) { $paged = get_query_var('paged'); } ...
0
votes
2answers
89 views

Pagination not working in secondary query

I'm trying to fix a theme which has the following setup: on each page the user can select to list posts instead of the page content. The problem is that the pagination doesn't work on this page even ...
1
vote
1answer
6k views

Pagination on category page with custom post types

Wordpress is not new for me but I am really stuck on this piece of code that I can not get to work properly. I register a custom post type News and let the custom post type use the Wordpress ...
0
votes
1answer
39 views

the paged param is allways 0

I am listing a custom post_type called ad using get_posts wich works fine, Problem that I have is that I am not able to read the paged param, wich I need in order to enable pagination, The thing is ...
0
votes
1answer
135 views

Print all content of a paged post

is it possible to print a complete post that has a number of pages? I'm working on a website that the client would like users to be able to print an article. The problem I have right now is when an ...
1
vote
1answer
2k views

Merged two WP_Queries, posts per page and pagination not working

I merged two WP_Queries with the code below, it has pagination setup as well as posts per page in the final combined object but those settings aren't working. My page shows 24 posts, where is it ...
0
votes
1answer
488 views

Next / previous posts link doesn't show up with Posts 2 Posts

I am working on a Wordpress project where I use the Posts 2 Posts plugin to show posts from one post type to posts from another post type. This works great but for some reason my next_posts_link() ...
-1
votes
1answer
170 views

paged query leads to 404? [duplicate]

As soon as I click the "2" on my pagination links I get a 404-error. The url correctly changes to http://mysite.com/?paged=2 <?php /** * The loop that displays the posts. */ ?> <ul class="...
0
votes
2answers
7k views

Using $paged redirects /page/2 to page 1

I've setup a custom query for my posts (single.php) with pagination, which by the way is working great with the default permalink structure. domain.com/p=ID&paged=2 if I switch the permalinks ...
0
votes
1answer
53 views

Query counting excluded category on paged loop

I have an Index.php with a basic loop with this query before: <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'category_name' => 'work', ...
0
votes
1answer
507 views

'paged' in wp_query doesn't work

I try to add a code to my wordpress blog show previous posts(in a previous page). I try this code but it don't work: <?php $paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1; $args = ...
0
votes
1answer
2k views

WP_Query orderby random do not repeat infinite scroll - one loop

I have found a lot of documentation on solving this issue with multiple loops, I'm finding it hard to see a solution for one custom loop. Problem: I'm using infinite scroll to load in the next page ...
0
votes
1answer
228 views

“paged” in WP_Query returns 0 posts

If i don't supply a paged value (get the first page), it works. But when i try to get the next page by doing paged => 2 it doesn't find anything even though there are plenty of posts to get. That'...
0
votes
1answer
105 views

List of filtered Events is breaking paging?

I have a list of events that are displaying in date order, with events in the past being hidden. The issue is that in total, there are 3 pages of events, but once the past events are hidden, there ...
0
votes
1answer
3k views

filter posts by meta key with pagination

Trying to filter out specific posts that have certain meta_key from the main query... problem is it doesnt work with pagination which is my issue here. Anyone knows how to solve this? $paged = (end( ...
0
votes
1answer
302 views

Archive template combined with post slider and regular posts

I am trying to find the best and easiest way of modifying my archive.php template to contain slider on top which slides the 4 first posts and the rest (6) will be displayed beneath as a regular posts. ...
3
votes
2answers
2k views

Why does pagination always break when used on any form of a home page?

Why does WP pagination break when used on the homepage? If you take the code below and use it in a page template it works perfectly (make sure you have 3 or more posts). However, as soon as you use ...
0
votes
2answers
136 views

Why won't my paged wp_query work? [duplicate]

Possible Duplicate: Pagination not working with custom loop Any ideas why this paged wp_query doesn't seem to want to work? I've tried replacing the pt_pagination function with the default next/...
0
votes
2answers
47 views

send user to first page of results when reposting to page?

I have a custom template with a drop-down that filters posts by category. I do it by making the form post to the page itself and then catching the argument and using it in a query (see code below). ...
1
vote
2answers
343 views

Does it make sense to assign functions like is_paged() to a variable rather than using it multiple times?

Actually a simple question, but I need to be sure that assigning a variable for the result of a function can help to increase the speed of a site e.g. The function: if is_paged(){ $paged = 1; } The ...
1
vote
2answers
3k views

Custom posts per page does not work with pagination

I have one page in my template where I would like to set a custom posts_per_page. Here is the code I have used: <?php global $query_string; query_posts($query_string . '&posts_per_page=4'); ...
2
votes
3answers
1k views

Customized first post techniques

There doesn't seem to be a standard technique for differentiating first/top posts. After looking around, I found this method: $current_query = new WP_Query('post_type=current&post_status=publish')...
2
votes
2answers
2k views

Customising rewrite rules for CPT single post URL to work as paged URL

I've got a CPT called Service registered as following: $args = array( 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'has_archive' => false, '...
0
votes
3answers
1k views

Using next/previous_posts_link with customised search

I have a few different searches on my website: "Species profiles" (custom post type search) "Glossary" (custom post type search) Generic, site-wide search Currently I'm using search.php; $_POST["...
1
vote
1answer
538 views

$paged always 0 on plugin's custom page

I'm making a plugin that loads a specific template depending on a certain query var being passed, in effect creating a page for the plugin on the front end, as outlined in this post: Create a page ...
0
votes
2answers
2k views

Having a variable based on $post_count increase when i move to the next page of results

I couldn't figure out the best way to write the title, so first of all I hope you understood what i was trying to get across. I have a snippet of code on my template page that fires after the wp_query ...
0
votes
1answer
182 views

Differnt page template for page 2 of blog feed

Is there a way I can use one page template (A custom page template for example) for the first page of my blog and then another template (Index.php for example) for page 2, 3, 4, etc.?
20
votes
3answers
24k views

How to determine if I'm on the first page of pagination?

How do I determine if I'm on the very first page of pagination? I'm using WP_Pagenavi. I want to run a function only on the first page of the pagination. I checked the query_var 'paged', it's set to 0 ...
0
votes
1answer
1k views

Difference between $numpages & $max_page on archive pages

After taking a look at global $max_page; and global $numpages; on category-archive pages (is_archive() || $GLOBALS['wp_query']->is_archive returning true), I see the following return values: $...
6
votes
3answers
19k views

get_query_var( 'paged' ) not working outside of homepage

Twenty Eleven Theme... On the home page, I have successfully filtered the loop to display just "Featured" posts with pagination functioning properly through nav links. I'm trying to display posts ...
2
votes
2answers
3k views

$wp_query->current_post restarts from zero on paged pages

I know how to keep track on the 'index' of the current post when running the loop using $wp_query->current_post Bu this restarts the count from zero on subsequent paged pages. So if I have 20 ...
0
votes
2answers
2k views

Get current page number of splitted article

I am trying to find a way to get the current page number of an article that has been splitted into several pages with the use of: <!-- nextpage --> There is an example that can be found here: ...
5
votes
1answer
8k views

Custom Taxonomy not working with posts_per_page in new WP_query (pagination problem)

OK, so i'm messing with Custom Taxonomies for the second time and in both instances i've run into this problem where using the posts_per_page argument in either a query_posts or WP_query scenario.. ...