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 [wp-link-pages]

The tag has no usage guidance.

0
votes
0answers
33 views

wp_link_pages how to attach a link to last <!--nextpage-->

I want to add a custom link to a last <!--nextpage-->. For example this is the page: Slide 1 <!--nextpage--> Slide 2 <!--nextpage--> Slide 3 <!--nextpage--> <- I want the *...
0
votes
1answer
24 views

wp_link_pages shortcode for 'nextpagelink'

I want 'nextpagelink' shortcode [nextpage_shortcode] that I can place inside content. I've seen threads where they say that you can't place anything related to the wp_link_pages inside content due to ...
1
vote
1answer
18 views

Post Pagination Customization (wp_link_pages) Editing Navigation

I want to create a post pagination where there is only ONE 'nextpagelink' button per page. However, I want the text inside the the first 'nextpagelink' to say "WELCOME". And I want the text inside ...
1
vote
1answer
24 views

How do I detect which page I'm on within a paginated post?

I'm using wp_link_pages() to paginate a post. I want to show something below the post content only on the first page of the post. Naturally I thought I'd use get_query_var('paged') to get the page ...
-1
votes
0answers
25 views

How to replace the existing root index page with a new WordPress index page?

I just finished a website redesign where I implemented a WordPress site instead of coding the whole thing by hand. Because I'm only working with a single domain and I didn't want to take the main ...
2
votes
1answer
69 views

How to insert text between the page numbers? [closed]

Inside my article I use the tag <!--nextpage-->. Now how to insert text between the page numbers. In HTML it should look like this: <div class="postlink"> <p style="text-align: center;"...
0
votes
1answer
34 views

Linking images in WordPress Paginated Post

I have a paginated post on WordPress with about 5 pages. I want to set it up so that the images in the content from the previous page automatically link to the following page. I've used the following ...
0
votes
1answer
43 views

using globals from wp_link_pages function

I'm following this reference page for wp_link_pages:https://developer.wordpress.org/reference/functions/wp_link_pages/ In it, 4 global variables are declared: $page, $numpages, $multipage, $more. I'...
0
votes
1answer
64 views

Override wp_link_pages pagebreak with filter

Is it possible to have conditional pagebreaks? For instance, if there is a match in the query string, the first page break of a post is ignored, and the user get's to read two posts in a row before ...
0
votes
2answers
665 views

How to make the <!--nextpage--> show as a button?

So currently my blog post has a "Pages: Next page" at the bottom of my blog post by putting <!--nextpage-a-> in the editor where I wanted to stop the first page. Also with the <?php ...
0
votes
1answer
21 views

Publish and go to page [duplicate]

Can I add a link to "Publish"-button so when it's clicked it publishes new post and direct to another page in same click?
2
votes
1answer
123 views

Can I add a 'show all pages' link to wp link pages?

I use wp_link_pages to paginate individual pages and posts. Is there a way I can add to it an extra link which'll show all pages together, on a single page rather than split?
2
votes
0answers
141 views

Display only the current page number and another numbered page in pagination

I need some help with pagination. The pagination should only display the current page and another numbered page, like so: << | 2 | …3 | >> At the moment, it shows all page numbers: <...
0
votes
1answer
304 views

WordPress post/page pagination (page links) to go back to the first section

I am using the page links: https://codex.wordpress.org/Styling_Page-Links as: wp_link_pages(array('before'=>'', 'next_or_number'=>'next', 'previouspagelink' => '&laquo;', 'nextpagelink'...
2
votes
3answers
511 views

When paginating a Page with the <!--nextpage--> tag, how can the 2nd and subsequent page styles be customised?

I want to apply different styles for a second page in single.php or posts. How can I do this? I have the following code in single.php to split the page in two parts: <!--nextpage--> If there ...
0
votes
1answer
353 views

How to ignore wp_link_pages function?

I've bought a wordpress theme. I want to ignore all wp_link_pages functions from theme files. I will write my custom codes. Is there any way to do it with functions.php
2
votes
1answer
203 views

Customizing wp_link_pages

I want to create a pagenation using wp_link_pages that looks like this Previous 3 of 20 Next How can this be achieved? I am using this function btw https://codex.wordpress.org/...
2
votes
2answers
490 views

wp_link_pages: display current page number only if has multiple page breaks?

I'm trying to build a function to display the current chapter (page) within the single.php file ONLY if there's more than one chapter (page break). This function will output the chapter # within the ...
3
votes
1answer
1k views

the_content and wp_link_pages

Many plugins seem to be adding a filter/action hook to the_content to display related posts, advertisements and such. The problem is I these appear before the post pagination so it the pagination is ...
1
vote
2answers
2k 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
1answer
1k views

Wordpress wp_link_pages show only next/prev link

I used nextpage to separate a post into multiple page and I don't want to show pagination as 1 2 3 Next, I want to to show Prev Next, below is the code I come up with after reading the wp link pages, ...
0
votes
1answer
13k views

How to get a page url by a page id?

I tried to use get_page_link('page-id') and get_permalink('page-id') but the error below occurred. Fatal error: Call to a member function get_page_permastruct() on null in ... How can I get a page ...
2
votes
1answer
143 views

Append a <!--nextpage--> to every post to force additional page link (and static content)

I'm trying to affect either the content or the $post->post_content directly, before the post get read by the wp_link_pages() function, to inject a little bit of static text or javascript after the ...
1
vote
0answers
231 views

Add query string to wp_link_pages links

I am attempting to add a query string to the output 'Next' and 'Previous' links that are produced from a modified wp_link_pages. In my functions.php I have: add_filter('wp_link_pages_args','...
0
votes
1answer
134 views

Add wp-link-pages to post

I am trying to add wp-link-pages function to my post where I have images split into many pages in that single post. I already have next and prev button whose functionality is written javascript. I ...
1
vote
0answers
564 views

Adding wp_link_pages to a theme that seems to lack?

I'm using wp-bootstrap as basis to build out a custom site. The wp_link_pages function doesn't seem to work and I'm thinking maybe it's just missing from the theme. I've got a code in a page and the ...
0
votes
2answers
3k views

Post Pagination Modifications (wp_link_pages)

I'm looking to modify how Wordpress is showing the pages of my posts. What I currently have is a previous and next page link at the bottom of the post with the following code: <?php wp_link_pages( ...
1
vote
2answers
710 views

add_filter('the_content', '…') stops pagination from working

I have a function (it deals with using preg_replace_callbackto replace Image URLs with URLs/paths to the uploads directory - lets call it replaceImgUrls()) which is then passed into add_filter('...
0
votes
1answer
1k views

How to customize wp_link_pages()?

Does anyone know how to customize wp_link_pages() so that <!--nextpage--> will show like "<< previous" and "next >>" links instead of "Pages: 1 2 3 "? Note:- i used "<!--nextpage-...
0
votes
2answers
1k views

query to use to link to taxonomy single page

Hi & thanks in advance to those who could help me sot out he below: I have customized my home page, using tpl-home.php to show the authors (eg users...) of the most recent posts - nothing ...
4
votes
1answer
766 views

Automatically add <!--nextpage--> after X number of paragraphs

Is it possible to automatically add the <!--nextpage--> quicktag after X number of paragraphs? My client isn't exactly tech savvy so I'm trying to find a way to help them break up their ...
0
votes
1answer
488 views

alternative to wp_link_pages() that only shows link to last page

I plan to have posts with multiple pages that would receive updates (added pages) over time. what i want to do is to display the direct link to the last page of the post on the main index. for ...
1
vote
2answers
1k views

Add Unique Classes to Next and Previous in WP_LINK_PAGES

I'm using the below function for wp_link_pages. It can be viewed in use here. I would like to add a class to the previous link and a class to the next link so they can be styled individually. I'm ...
1
vote
1answer
1k views

Only nextpagelink on wp_link_pages

Does someone have a solution to display only the nextpagelink with wp_link_pages in single posts? I've tried different solutions, but none of it worked. As I reach the last page - wp_link_pages ...
0
votes
3answers
1k views

Make wp_link_pages() suitable for Twitter Bootstrap markup

Below there's the Wordpress code found in post-template.php for the wp_link_pages() function - this function generates a page navigation for posts or pages having the content split into multiple pages....
0
votes
1answer
116 views

WP_LINK_PAGES Generating Unnecessary </p> Tag

This is the current output for my WP_LINK_PAGES, notice the unnecessary </p> tag at the end. My code for my custom WP_LINK_PAGES can be found here. <div id="link_wrap"> <span class="...
0
votes
1answer
48 views

Closing WP_LINK_PAGES DIV ID w/After Argmuent

In my code below I need to close the div "link_wrap" which I created with $args['before'] = '<div id="link_wrap">'; When I try to paste $args['after'] = '</div>'; above return $args; it ...
0
votes
1answer
159 views

Unable to Change “Pages:” Before WP_LINK_PAGES

Below is a functions.php code for wp_link_pages which allows pagination and previous/next links to be displayed. It also wraps each pagination link in a span class called "classlinks". I need to ...
0
votes
1answer
50 views

Adding an Unlinked Space in a Custom Function

This question has been a pain in my side for the last few days. I am using a function to display page numbers and next/previous links with WP_LINK_PAGES. The code I'm using (below) is a shortened ...
2
votes
1answer
780 views

Add a Class to Current Page WP_LINK_PAGES

I've noticed WordPress has some illogical differences between wp_link_pages and paginate_links. Specifically, WP_LINK_PAGES does not automatically add a class to the current page like paginate_links ...
0
votes
1answer
283 views

Remove Spaces From WP_LINK_PAGES

By default, wp_link_pages (the code which allows you to breakup posts into multiple pages) creates spaces between each number. Is there a way to remove these spaces via functions.php?
0
votes
2answers
363 views

How can I display wp_link_pages before a shortcode, if it is used, or display after content?

I have the following shortcode in my content [src]<a href="#">Some Link</a>, <a href="#">Some Other Link</a>[/src] My post structure looks like this: <?php echo $content; ...
0
votes
1answer
5k views

Changing wp_link_pages() to “Next Page” and “Previous Page” buttons?

Currently I am using <!--nextpage--> to split a post into multiple pages, but I would like to change from Pages: 1 2 3 4 to Next Page and Previous Page links similar to what you see on this ...
3
votes
1answer
3k views

Check if on last page of paginated post using wp_link_pages

A client of mine reviews products on his site, and wants to display the review criteria and score on the last page of each posts. Typically, there are 3-5 pages per post, and I'm looking for a way to ...
1
vote
0answers
184 views

Adding range to wp_link_pages()

I have some very long posts, some have more than 50 pages (<!--nextpage-->) and when using wp_link_pages, it give me 50 internal post links, clearly this isn't usable. How can I add a range to ...
1
vote
0answers
510 views

Limiting number of visible links displayed with wp_link_pages

I need to extend the wp_link_page function to only show a max of 5 links at a time. What is the best approach to limit the number of links? In the end i'd like it to look like this: Previous 1 2 3 4 ...
0
votes
1answer
803 views

wp_link_pages appearing after post content and not at bottom of page

This code worked perfectly! But my issues is that it removes text on pages. I just need the page numbering to appear immediately after the post and not at the bottom of the page. Any suggestions? ...
1
vote
1answer
1k views

PHP code to use on next & previouspage links

I'm having an issue with wp_link_pages tag. I want to list the number of pages of each post with 'next' and 'previous' links that are two image arrows. To better understand the problem I'm having, ...
0
votes
2answers
2k views

Make Current/Active Page Number a Link (WP_LINK_PAGES)

With the default wp_link_pages the current/active page number is not a link. I would like to find a code/hack which turns the current/active page into a link to the top of the page. I am already ...
0
votes
3answers
3k views

Making a Killer wp_link_pages

I am trying to achieve a similar look to the image below, a working example can be found here: http://www.menshealth.com/celebrity-fitness/mark-wahlberg-fighter-workout The needed code must do the ...