WordPress.org

Make WordPress Core

Opened 11 years ago

Last modified 9 months ago

#7231 accepted enhancement

wp_link_pages: option next_and_number

Reported by: jan831 Owned by: sorich87
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: has-patch needs-refresh needs-testing
Focuses: template Cc:
PR Number:

Description

with the next_or_number option of the wp_link_pages() function, it would be nice to have the option to use both.

it gives the user the opportunity to easily go to the next/previous page, without loosing the other option of going immediately to a certain page

example:
next 1 2 3 4 5 6 previous

Attachments (7)

patch_next_and_number.diff (3.1 KB) - added by jan831 11 years ago.
patch to add this functionality (applies to /trunk/)
7231.patch (4.0 KB) - added by sorich87 9 years ago.
7231.2.patch (8.6 KB) - added by seanchayes 4 years ago.
2015-pagination-styling-issue.jpg (62.8 KB) - added by seanchayes 4 years ago.
2015 displaying styling issue
2015-pagination-with-adjusted-styling.jpg (75.4 KB) - added by seanchayes 4 years ago.
2015 with adjusted styling
2016-pagination-styling-issue.jpg (49.4 KB) - added by seanchayes 4 years ago.
2016 displaying styling issue
2016-pagination-with-adjusted-styling.jpg (50.6 KB) - added by seanchayes 4 years ago.
2016 with adjusted styling

Download all attachments as: .zip

Change History (20)

@jan831
11 years ago

patch to add this functionality (applies to /trunk/)

#1 @jan831
11 years ago

  • Keywords has-patch added

#2 @ryan
11 years ago

  • Milestone changed from 2.7 to 2.8

Moving enhancements to 2.8.

#3 @Denis-de-Bernardy
11 years ago

  • Keywords needs-patch added; has-patch removed
  • Milestone changed from 2.8 to Future Release

broken patch

#4 @Denis-de-Bernardy
11 years ago

  • Component changed from General to Template

#5 @Denis-de-Bernardy
10 years ago

  • Milestone changed from Future Release to 2.9

#6 @ryan
10 years ago

  • Milestone changed from 2.9 to Future Release

@sorich87
9 years ago

#7 @sorich87
9 years ago

  • Keywords has-patch added; needs-patch removed
  • Owner changed from anonymous to sorich87
  • Status changed from new to accepted

Here is a new patch.

#8 @nacin
6 years ago

  • Component changed from Template to Posts, Post Types
  • Focuses template added

#9 @wonderboymusic
4 years ago

  • Keywords needs-refresh added

#10 @seanchayes
4 years ago

Ok. I've reworked this patch and uploaded 7231.2.patch

There appears to be no default styling in Twenty Fourteen, TwentyFifteen or TwentySixteen accommodate for the "Next" and "Previous" links created by this function before this patch. As such in the course of creating this patch I manually added styling to those themes for testing. Samples of what I saw for these themes have also been uploaded.

My patch also adds classes, "next" and "previous" to the relevant links to allow for them to be styled. See below.

.page-links .previous,
.page-links .next {
        width: auto;
}

I don't know how best to address this within the patch. So, my guess is to open an additional ticket for that styling to be considered for inclusion.

And now, the parameter "next_or_number" now is mis-named as the existing two options now included a third. I suspect we would keep the parameter name for the time being and/or introduce something like "pagination_style" going forward. I have left the parameter name as is for the time being.

@seanchayes
4 years ago

#11 @seanchayes
4 years ago

  • Keywords needs-testing added

@seanchayes
4 years ago

2015 displaying styling issue

@seanchayes
4 years ago

2015 with adjusted styling

@seanchayes
4 years ago

2016 displaying styling issue

@seanchayes
4 years ago

2016 with adjusted styling

#12 @seanchayes
4 years ago

In the "styling issue" images I have highlighted the white on white text to make it show - for the purposes of demonstrating the issue.

#13 @wonderboymusic
4 years ago

#10558 was marked as a duplicate.

Note: See TracTickets for help on using tickets.