paginate_links URL
Change variable page to something else, page is a reserved keyword & whenever in url it found it convert url in to localhost/wordpress/page/2
Change variable page to something else, page is a reserved keyword & whenever in url it found it convert url in to localhost/wordpress/page/2
In your single.php add this example code inside the loop: <?php global $page; if ($page == 1) {?> <div style=”color:red;”>This text should only appear on first page of the post!!!</div> <?php } ?> you can change the div with your thing that you wanted to display only on the first post page..
I was actually dealing with this same issue earlier today. I compared the code I’d written for a site using paginate_links() a few weeks prior ( where it worked ) and the site I was working on today ( where it didn’t work ) and found the deal-breaker: when you associate the page number in … Read more
You cannot do this with the default paginate_links() functions. Looking at the source code, there are no filters from which you can change the layout as you wish ALTERNATIVE SOLUTIONS Although you cannot do this by default, it doesn’t mean that you cannot get your desired output. Here is a couple of options to explore … Read more
I had a quick look at the source, and it does seem that the problem comes in at line 2267 (current version 4.1). I will however need to do some testing at some stage to make sure that this is a bug, but on face value, this is the only place I can see that … Read more
I fixed this using another post – Pagination Error on Admin (You do not have sufficient permissions) Basically I needed to changed the $paged argument to $paged = isset( $_REQUEST[‘paged’]) ? max( 1, ( int ) $_REQUEST[‘paged’] ) : 1; and the $pl_args argument to $pl_args[‘base’] = admin_url( ‘admin.php?page=cpd-admin-page&paged=%_%’ );
First, try rebuilding your permalinks. Go to Settings >> Permalinks and click Save, which will rebuild them. If that doesn’t work, go into your Settings >> Reading >> Blog pages show at most setting and try increasing or decreasing that and see how that changes things. Some themes have a setting that lets you adjust … Read more
This is a problem with the paginate_links function and having your default permalink structure set to postname/custom but wanting the pagination to use default link structure. If you look at the code – https://core.trac.wordpress.org/browser/tags/4.8/src/wp-includes/general-template.php#L0 You can see the following at the top of the paginate_links function // Setting up default values based on the current … Read more
First things first, you’re throwing away the default query for the page (after it hits the DB and sets up the globals) with your custom query. The pagination is referring to the default query for the template, which is defined in Settings > Reading, plus you’re hitting the DB twice for the same thing, which … Read more
You are using the code from the example in the Codex, but this is for the default “plain” permalinks for the default blog homepage. My guess is that you are doing this for an archive rather than the homepage. Search & Archive pages By default, paginate_links assumes the pagination is for the blog on the … Read more