- This topic has 3 replies, 2 voices, and was last updated 7 years, 11 months ago by .
- The forum ‘General Discussion’ is closed to new topics and replies.
These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.
I'm looking to style the pagination on my genesis sample child theme in a way that it only displays "Next Page" and "Previous Page".
I do not want the number of pages to be shown. Is there a way to remove the numbers, and only leave the "Next" and "Previous" links?
<?php $args = array( 'before' => '<div class="pagenums"><div class="pages">', 'after' => '</div></div>', 'next_or_number' => 'next', 'nextpagelink' => __('Next Page'), 'previouspagelink' => __('Previous Page'), 'pagelink' => '%', 'echo' => 1 ); ?> <?php wp_link_pages( $args ); ?>
The "Next Page" and "Previous Page" text can be changed to whatever you'd like.
Thanks for your response. Do I add this to my post.php file?
I found this code before but wasn't 100% sure of where to place it.
Try just popping it into functions.php, I'm not actually sure how code outside of a hook or filter function runs there. If that doesn't work, try wrapping it in an add_action function, since it's just logic, and not actually altering anything visually, it won't matter.
© 2023 WPEngine, Inc.