Forums

Conditional statement for register page (6 posts)

  1. ranji77
    Member
    Posted 1 year ago #

    Hi,

    I hope this is an easy question to answer. I am currently themeing my wordpress login page. However, there are some conditional statements I'd like to use for headers and such that I can't figure out.

    For example, my login url is: http://sitename.com/login/ (this is using a page template called login.php)

    However, when a user clicks on register, it takes them to: http://sitename.com/login/?action=register

    My question is if there is a wordpress conditional statement to only target the register page? I am using is_page('login') for my first login url, but can't figure out how to target my register page.

    Any help would be appreciated, thanks in advance!

  2. ranji77
    Member
    Posted 1 year ago #

    bump, please anyone know?

  3. ranji77
    Member
    Posted 1 year ago #

    last bump, promise...really hoping someone would know this though.

  4. Thejas Kamath
    Member
    Posted 1 year ago #

    I think there is one solution. But I am not sure whether it will work or not. Since only some of the people face this problem, there are no more posts on this and many of them don't know how to resolve the problem.

    My idea is:-

    1) Open your Website Cpanel (Not the Admin panel)
    2) Under Domains, click redirects
    3) And create a redirect from http://sitename.com/login/?action=register to http://sitename.com/login.

    So whenever, a user clicks on register link, it will automatically redirect to http://sitename.com/login where they can login or register.

    Hope this helped you!

  5. ranji77
    Member
    Posted 1 year ago #

    Thanks Thejas, but I don't want to redirect my register page to the normal login page. I'm just looking to do some conditional statements so I can change the title headers from "Login" to "Register". Since they are both technically using the login.php template I have created, I can't differentiate between the two.

  6. Thejas Kamath
    Member
    Posted 1 year ago #

    Yes, you can edit wp-login.php and paste in a different folder where you can edit all the headers. By doing this, the changes you have made won't reset when you upgrade!

    Thanks:)

Topic Closed

This topic has been closed to new replies.

About this Topic