WordPress.org

Ready to get started?Download WordPress

Forums

redirect_to with an anchor? (1 post)

  1. donzacharias
    Member
    Posted 5 years ago #

    I'm trying to provide a link in the comments form that takes the user to the login page, and redirects them to the #id of the comments form, so they go right back where they came from. So I constructed the link like so...

    <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo get_permalink($post->ID);?>#commentform">Log in (registered user)</a>

    But it keeps lopping off #commentform. Does anybody know why it is doing that? Thanks in advance!

Topic Closed

This topic has been closed to new replies.

About this Topic