• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Remove Pagination Numbers

Welcome!

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.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Remove Pagination Numbers

This topic is: resolved

Tagged: pagination

  • This topic has 3 replies, 2 voices, and was last updated 7 years, 11 months ago by Porter.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • October 21, 2015 at 11:20 am #168670
    jackirt
    Member

    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?

    Many thanks.

    October 21, 2015 at 12:54 pm #168673
    Porter
    Participant
    <?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.

    Source


    Buy me a beer? | Try DigitalOcean VPS Hosting

    October 21, 2015 at 2:12 pm #168679
    jackirt
    Member

    Hi Porter,

    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.

    October 21, 2015 at 2:30 pm #168680
    Porter
    Participant

    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.


    Buy me a beer? | Try DigitalOcean VPS Hosting

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble