WordPress.org

Ready to get started?Download WordPress

Forums

WP-PageNavi
how to add anchor to the page link (5 posts)

  1. severins
    Member
    Posted 3 years ago #

    Hi!

    First of all thank you very much for the great plugin. Must have imo!

    I have a gallery at the top of my site and the blog posts below it. Each time I go to the next page it loads at the top. I want to add a simple anchor - lets call it 'blog' - just below the gallery and add #blog to pagenavi links. Could you please tell me where in the code should I put #blog to make it work?

    Thank you in advance!

  2. severins
    Member
    Posted 3 years ago #

    I think that most probably I should change line 164 in core.php:

    return "<a href='" . esc_url( get_pagenum_link( $page)) ."' class='$class'>$text</a>";

    but how exactly???

  3. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    return "<a href='" . esc_url( get_pagenum_link( $page)) ."#blog' class='$class'>$text</a>";

  4. severins
    Member
    Posted 3 years ago #

    scribu,

    Thanks for reply. Your solution works - link looks .../page/2/#blog

  5. severins
    Member
    Posted 3 years ago #

    any idea how to do the same with previous/next page links?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic