Community Forums › Forums › Archived Forums › General Discussion › How to modify numeric archive pagination?
Tagged: content archives, numeric pagination
- This topic has 10 replies, 3 voices, and was last updated 11 years, 3 months ago by
exelexys.
-
AuthorPosts
-
August 5, 2014 at 6:44 am #117150
exelexys
MemberWould like to change the HTML tags of numeric pagination of content archives set in Genesis Theme Settings:
What's the (best) way to modify the output of numeric pagination for content archives?
Many thanks in advance!
August 5, 2014 at 7:09 am #117152Brad Dalton
ParticipantThis might help otherwise you might need to dig into Genesis http://my.studiopress.com/snippets/post-navigation/#customize-newer-posts
August 5, 2014 at 8:50 am #117163exelexys
MemberThanks for sharing. Is there a way to modify Genesis (like in this case) without modifying its core code?
August 5, 2014 at 8:14 pm #117232Brad Dalton
ParticipantYes
Using the filters included in the code which generates the pagination function in Genesis or any WordPress filters included in any functions Genesis uses for the pagination.
You will be able to see all the WordPress/Genesis functions and filters in the Genesis code as well as in the code i linked to.
I don't have the code for this solution at this point in time otherwise i would provide it.
August 5, 2014 at 8:49 pm #117242exelexys
MemberAugust 5, 2014 at 9:19 pm #117247August 5, 2014 at 10:17 pm #117263Brad Dalton
ParticipantI don't think that applies to archive page links.
I wrote about that last week and it applies to use of wp_link_pages for the more tag.
There will be code in Genesis that does which i will post here when i find it.
August 5, 2014 at 11:35 pm #117288Brad Dalton
ParticipantAugust 6, 2014 at 1:25 am #117295emmtre
ParticipantAny idea what to change if you only want one page before and after current page to save space on mobile devices? Is it ok to just remove the -2 and +2 links in the code or do i have to change some other parameters and code as well?
//* Add the pages around the current page to the array if ( $paged >= 3 ) { $links[] = $paged - 1; $links[] = $paged - 2; } if ( ( $paged + 2 ) <= $max ) { $links[] = $paged + 2; $links[] = $paged + 1; }August 6, 2014 at 3:00 am #117302Brad Dalton
ParticipantI wouldn't modify any of the code in Genesis however you can create a custom function with the code and use it in your child theme if you can't get the result you want using the filters.
I don't have any code written and tested to do exactly what you want at this pint in time and it would take some playing around with to work out the best solution so i can only try and point you in the right direction at this stage.
August 8, 2014 at 4:14 pm #117823exelexys
MemberThanks for taking the time to share the code. Much appreciated, as always.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.