Hi! If I understand correctly, you want to redirect users to your custom register page, when they clicked on login, and the login modal’s bottom “Don’t have an account yet? Register” button? Because currently this is the only one option as I know, what call the register modal “#user_register_modal”. On my website I have a same custom register page, and I created a header menu button for that, so it’s easly visible for non registered users. But if a user clicking on that modal “Register” button, you can override that template easily.
- Create this folders, and the file (user-register-link.php) in your theme/child theme library:
hivepress/user/login/user-register-link.php
public_html/
└── wp-content/
└── themes/
└── your-child-theme/
└── hivepress/
└── user/
└── login/
└── user-register-link.php
add this code into that file:
<?php
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
if ( get_option( 'hp_user_enable_registration', true ) ) :
?>
<p class="hp-form__action hp-form__action--user-register"><?php esc_html_e( 'Don\'t have an account yet?', 'hivepress' ); ?> <a href="https://yourwebsite.com/registerpage/"><?php esc_html_e( 'Register', 'hivepress' ); ?></a></p>
<?php
endif;
?>
Replace this: “https://yourwebsite.com/registerpage/” to your register page url.
Save, and if you have any caching plugin or solution, purge cache, because this will not work!
If you want to redirect when they click on the HivePress login button, it’s a same procedure, just create this file, in the same folder what you created: “user-login-link.php” and copy this into that file:
<?php
if ( is_user_logged_in() ) :
?>
<a href="<?php echo esc_url( hivepress()->router->get_url( 'user_account_page' ) ); ?>" class="hp-menu__item hp-menu__item--user-account hp-link">
<i class="hp-icon fas fa-user"></i>
<span><?php echo esc_html( hivepress()->request->get_user()->get_username() ); ?></span>
<?php if ( hivepress()->request->get_context( 'notice_count' ) ) : ?>
<small><?php echo esc_html( hivepress()->request->get_context( 'notice_count' ) ); ?></small>
<?php endif; ?>
</a>
<?php elseif ( get_option( 'hp_user_enable_registration', true ) ) : ?>
<a href="https://yourwebsite.com/loginpage/" class="hp-menu__item hp-menu__item--user-login hp-link">
<i class="hp-icon fas fa-sign-in-alt"></i>
<span><?php esc_html_e( 'Sign In', 'hivepress' ); ?></span>
</a>
<?php
endif;
Don’t forget to purge cache.