• 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

Add anchor link to genesis pagination

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 › StudioPress Themes › Magazine Pro › Add anchor link to genesis pagination

This topic is: not resolved

Tagged: pagination genesis

  • This topic has 4 replies, 3 voices, and was last updated 1 year, 4 months ago by Anita.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • February 26, 2021 at 12:43 pm #503222
    hudson92
    Participant

    Hi,

    I have archive pages where the genesis loop displaying the posts starts about halfway down the page. The problem I have is that when you click next/previous on the pagination links the user is taken to the top of the new page and has to scroll down to view the posts.

    How can you add an anchor to the pagination links so that the user is brought to the correct part of the page? I'm gone through the /genesis/lib/structure/post.php file which is where the pagination hooks live but can't figure out a solution to inserting an anchor to the pagination link.

    Any help much appreciated!

    February 27, 2021 at 5:37 am #503227
    Anita
    Keymaster

    We need a link to your website to check that out. And what theme are you using?


    Love coffee, chocolate and my Bella!

    March 1, 2021 at 9:26 am #503258
    hudson92
    Participant

    Hi Anita,

    The site is currently just in local development so I don't have a live link. The theme I am using is Magazine Pro.

    Thank you

    March 1, 2021 at 10:01 am #503259
    Victor Font
    Moderator

    I walk through the Genesis code for pagination, and I'm not sure there's a way to accomplish this through Genesis. The pagination is depending on the WP Query to get to the appropriate page. The page link you see is not a permalink. In other words, these links are created on the fly. There are no pages in the system with a permalink of page/2 until run time.

    You could potentially do this with jQuery. With jQuery, you can read the current URL. If the URL contains the /page/ string, you can scroll the page down to the element with the genesis-content ID or another appropriate ID depending on how your archive page is constructed.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    March 1, 2021 at 10:23 am #503261
    Anita
    Keymaster

    @hudson92 Bill Erickson has a tutorial on Pagination in a Custom Query. I asked him if there was a way to do what you want with his tutorial and he responded:

    Add an ID on the div that contains the posts (ex: #content) and then add that to the end of your url, like yoursite.com/page/2#content

    I'm glad I asked him. That really a cool way to do that!


    Love coffee, chocolate and my Bella!

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Log In

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2022 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