• 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

saving the current url by clicking the comment link

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 › Design Tips and Tricks › saving the current url by clicking the comment link

This topic is: not resolved

Tagged: comment link, onclick, save url

  • This topic has 2 replies, 2 voices, and was last updated 10 years, 7 months ago by cyanoorange.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • April 17, 2015 at 1:31 pm #148269
    cyanoorange
    Participant

    Hi, I want to do the following:
    When you click on the commentsbutton in a post, the current link (with anchor) should be saved in a variable.
    I have a goback button in the comments-section. If this button is clicked, the user should be directed to the saved url.
    A normal go back in history function doesnt work, because if a user entered a comment the history has changed.

    It looks like the link to the comments section is located in the function genesis_post_comments_shortcode
    (...)
    $comments = sprintf( '%s', get_comments_link(), $comments );
    (...)

    right?

    My idea was to insert a onclick='saveMyUrlFunction();' to the link - but I have no clue, how I to do this. Or is there a better way to solve the problem.
    Would be great, if someone could help.

    May 10, 2015 at 12:13 pm #151548
    Ginger
    Participant

    Hi there,

    The comments button would be actually submitting the comment so I'm a little confused at what you're trying to accomplish? Clicking back is basically refreshing the post since the comment has already been entered. If this is still something you are trying to solve can you provide a link and any additional details?

    Thanks!


    @gscoolidge | Support Nerd | Website Producer/Tweaker | IDX Integrations | Hosting Options

    May 11, 2015 at 1:38 am #151654
    cyanoorange
    Participant

    Hi Ginger,
    its still something I am trying to solve, but right now I cant give a link, because this site is not online right now (just on a local server).
    Just to try it in other words:
    I would like to have a back button on my comments site, which should bring the user back to the place where he was before he was entering the comments section. Therefore its not enough to make a normal "back button", because if the user has entered a comment on the comment site (and was not only reading the comments) the site history changes and the back button would send you to the comment site again, cause that was the last refreshment.
    Thats why I need to "remember" where the user came from. Means, when they click at the "go to comments" - Button, it woud be great to save the sites url and to call it, if the user wants to get back.

    But you are right, I should ask the question again, when I can show what I mean.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design Tips and Tricks’ 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

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