Skip to:
Content
Pages
Categories
Search
Top
Bottom

Why “Login Here” shows up instead of Form?

Viewing 13 replies - 1 through 13 (of 13 total)

  • Robin W
    Moderator

    @robin-w

    login here came with 2.6.x

    bbpress has a template in

    \templates\default\bbpress\form-user-login.php

    you can change this to have a click link to any url you wish

    find
    wp-content/plugins/bbpress/templates/default/bbpress/form-user-login.php

    transfer this to your pc and edit

    and save

    create a directory on your theme called ‘bbpress’
    ie wp-content/themes/%your-theme-name%/bbpress

    where %your-theme-name% is the name of your theme

    Then amend this file to take out the current form and put in a link

    Then transfer the file you saved above and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/form-user-login.php

    bbPress will now use this template instead of the original


    cosmiclove1978
    Participant

    @cosmiclove1978

    Hi Robin!
    Thanks for your quick reply and assistance. But there’s only one major challenge (at least to me) I am currently facing, which I’ll describe below:

    Re: — “Then amend this file to take out the current form and put in a link”

    I get the “what” to-do part (i.e. amending file…, creating a folder in my child theme, etc) but as for the “how?”, I have absolutely no idea. In all humility, I make no pretense of familiarity with php syntax or anything php code-related.

    I see the <form>….</form> tags in my file below, should I remove it all and place https://mydomain.com/login?

    <?php
    
    /**
     * User Login Form
     *
     * @package bbPress
     * @subpackage Theme
     */
    
    // Exit if accessed directly
    defined( 'ABSPATH' ) || exit;
    
    ?>
    
    <form method="post" action="<?php bbp_wp_login_action( array( 'context' => 'login_post' ) ); ?>" class="bbp-login-form">
    	<fieldset class="bbp-form">
    		<legend><?php esc_html_e( 'Log In', 'bbpress' ); ?></legend>
    
    		<div class="bbp-username">
    			<label for="user_login"><?php esc_html_e( 'Username', 'bbpress' ); ?>: </label>
    			<input type="text" name="log" value="<?php bbp_sanitize_val( 'user_login', 'text' ); ?>" size="20" maxlength="100" id="user_login" autocomplete="off" />
    		</div>
    
    		<div class="bbp-password">
    			<label for="user_pass"><?php esc_html_e( 'Password', 'bbpress' ); ?>: </label>
    			<input type="password" name="pwd" value="<?php bbp_sanitize_val( 'user_pass', 'password' ); ?>" size="20" id="user_pass" autocomplete="off" />
    		</div>
    
    		<div class="bbp-remember-me">
    			<input type="checkbox" name="rememberme" value="forever" <?php checked( bbp_get_sanitize_val( 'rememberme', 'checkbox' ) ); ?> id="rememberme" />
    			<label for="rememberme"><?php esc_html_e( 'Keep me signed in', 'bbpress' ); ?></label>
    		</div>
    
    		<?php do_action( 'login_form' ); ?>
    
    		<div class="bbp-submit-wrapper">
    
    			<button type="submit" name="user-submit" id="user-submit" class="button submit user-submit"><?php esc_html_e( 'Log In', 'bbpress' ); ?></button>
    
    			<?php bbp_user_login_fields(); ?>
    
    		</div>
    	</fieldset>
    </form>

    My question is and where do I amend this form-user-login.php file with my login url https://mydomain.com/login/?

    If given a blueprint, I can certainly reproduce the steps faithfully when dealing with a similar issue

    Can you (or anyone willing) please pinpoint the parts/lines to modify with the url? Thanks so much in advance.


    Robin W
    Moderator

    @robin-w

    ok, can you you confirm that you know how to FTP a file to your PC and back again ?

    That will save a lot of explaining !!


    cosmiclove1978
    Participant

    @cosmiclove1978

    Oh, FTP’ing? Sure, I can do that. I use FileZilla.

    Thanks Robin!
    H


    Robin W
    Moderator

    @robin-w

    ok, delete ALL of the contents of form-user-login.php and instead put

    <a href="https://mydomain.com/login/">Login here</a>

    and that’s what will show 🙂


    cosmiclove1978
    Participant

    @cosmiclove1978

    Hi Robin,

    I’ve deleted the content in the form-user-login.php and replaced it as instructed but I see no changes so far.
    file in child theme

    As shown in the screenshot above, the amended file has been uploaded to my child theme. Anything I’m doing wrong? The instructions you gave were easy to follow, so I’m not sure why it remained unchanged.

    From my website, bottom of the page, you can see an example of “Login Here” :
    frenchtasticpeople dot com/lab2/forum/60-day-intensive-training-for-beginners-of-french-grammar/welcome-forum-say-bonjour-to-the-french-community/ (I’ve edited the “dot com” part for obvious reasons)

    I am open to other suggestions if you have any for me. Grateful for your assistance.
    H


    Robin W
    Moderator

    @robin-w

    from that list, looks like you are running wp-rocket, so you’ll need to clear all caches to get the change to take effect


    cosmiclove1978
    Participant

    @cosmiclove1978

    Cleared all caches (browser, wp-rocket, cloudflare and dynamic cache directly from server)

    Still get the login url appearing as shown here. Hmm…
    login url screenshot


    Robin W
    Moderator

    @robin-w

    ok, I’ll need a link to the live example to try and help further


    cosmiclove1978
    Participant

    @cosmiclove1978

    Hello Robin,

    Here is a link to a live page provided earlier. Please, just convert “dot come” to “.com”

    From my website, bottom of the page, you can see an example of “Login Here” :
    frenchtasticpeople dot com/lab2/forum/60-day-intensive-training-for-beginners-of-french-grammar/welcome-forum-say-bonjour-to-the-french-community/ (I’ve edited the “dot com” part for obvious reasons)

    Thanks for your support!
    H


    Robin W
    Moderator

    @robin-w

    can you have a look at your parent theme to see if it has a folder ‘bbpress’ with form-topic.php

    in it


    cosmiclove1978
    Participant

    @cosmiclove1978

    Hi Robin,

    Yes, I can see form-topic.php in the parent theme.

    <?php
    
    /**
     * New/Edit Topic
     *
     * @package bbPress
     * @subpackage Theme
     */
    
    ?>
    
    <?php if ( !bbp_is_single_forum() ) : ?>
    
    <div id="bbpress-forums">
    
    	<?php bbp_breadcrumb(); ?>
    
    <?php endif; ?>
    
    <?php if ( bbp_is_topic_edit() ) : ?>
    
    	<?php bbp_topic_tag_list( bbp_get_topic_id() ); ?>
    
    	<?php bbp_single_topic_description( array( 'topic_id' => bbp_get_topic_id() ) ); ?>
    
    <?php endif; ?>
    
    <?php if ( bbp_current_user_can_access_create_topic_form() ) : ?>
    
    	<div id="new-topic-<?php bbp_topic_id(); ?>" class="bbp-topic-form">
    
    		<form id="new-post" name="new-post" method="post" action="<?php the_permalink(); ?>">
    
    			<?php do_action( 'bbp_theme_before_topic_form' ); ?>
    
    			<fieldset class="bbp-form">
    				<legend>
    
    					<?php
    						if ( bbp_is_topic_edit() )
    							printf( __( 'Now Editing &ldquo;%s&rdquo;', 'bbpress' ), bbp_get_topic_title() );
    						else
    							bbp_is_single_forum() ? printf( __( 'Create New Topic in &ldquo;%s&rdquo;', 'bbpress' ), bbp_get_forum_title() ) : _e( 'Create New Topic', 'bbpress' );
    					?>
    
    				</legend>
    
    				<?php do_action( 'bbp_theme_before_topic_form_notices' ); ?>
    
    				<?php if ( !bbp_is_topic_edit() && bbp_is_forum_closed() ) : ?>
    
    					<div class="bbp-template-notice">
    						<p><?php _e( 'This forum is marked as closed to new topics, however your posting capabilities still allow you to do so.', 'bbpress' ); ?></p>
    					</div>
    
    				<?php endif; ?>
    
    				<?php if ( current_user_can( 'unfiltered_html' ) ) : ?>
    
    					<div class="bbp-template-notice">
    						<p><?php _e( 'Your account has the ability to post unrestricted HTML content.', 'bbpress' ); ?></p>
    					</div>
    
    				<?php endif; ?>
    
    				<?php do_action( 'bbp_template_notices' ); ?>
    
    				<div>
    
    					<?php bbp_get_template_part( 'form', 'anonymous' ); ?>
    
    					<?php do_action( 'bbp_theme_before_topic_form_title' ); ?>
    
    					<p>
    						<label for="bbp_topic_title"><?php printf( __( 'Topic Title (Maximum Length: %d):', 'bbpress' ), bbp_get_title_max_length() ); ?></label><br />
    						<input type="text" id="bbp_topic_title" value="<?php bbp_form_topic_title(); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_topic_title" maxlength="<?php bbp_title_max_length(); ?>" />
    					</p>
    
    					<?php do_action( 'bbp_theme_after_topic_form_title' ); ?>
    
    					<?php do_action( 'bbp_theme_before_topic_form_content' ); ?>
    
    					<?php bbp_the_content( array( 'context' => 'topic' ) ); ?>
    
    					<?php do_action( 'bbp_theme_after_topic_form_content' ); ?>
    
    					<?php if ( ! ( bbp_use_wp_editor() || current_user_can( 'unfiltered_html' ) ) ) : ?>
    
    						<p class="form-allowed-tags">
    							<label><?php _e( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:','bbpress' ); ?></label><br />
    							<code><?php bbp_allowed_tags(); ?></code>
    						</p>
    
    					<?php endif; ?>
    
    					<?php if ( bbp_allow_topic_tags() && current_user_can( 'assign_topic_tags' ) ) : ?>
    
    						<?php do_action( 'bbp_theme_before_topic_form_tags' ); ?>
    
    						<p>
    							<label for="bbp_topic_tags"><?php _e( 'Topic Tags:', 'bbpress' ); ?></label><br />
    							<input type="text" value="<?php bbp_form_topic_tags(); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_topic_tags" id="bbp_topic_tags" <?php disabled( bbp_is_topic_spam() ); ?> />
    						</p>
    
    						<?php do_action( 'bbp_theme_after_topic_form_tags' ); ?>
    
    					<?php endif; ?>
    
    					<?php if ( !bbp_is_single_forum() ) : ?>
    
    						<?php do_action( 'bbp_theme_before_topic_form_forum' ); ?>
    
    						<p>
    							<label for="bbp_forum_id"><?php _e( 'Forum:', 'bbpress' ); ?></label><br />
    							<?php
    								bbp_dropdown( array(
    									'show_none' => __( '(No Forum)', 'bbpress' ),
    									'selected'  => bbp_get_form_topic_forum()
    								) );
    							?>
    						</p>
    
    						<?php do_action( 'bbp_theme_after_topic_form_forum' ); ?>
    
    					<?php endif; ?>
    
    					<?php if ( current_user_can( 'moderate' ) ) : ?>
    
    						<?php do_action( 'bbp_theme_before_topic_form_type' ); ?>
    
    						<p>
    
    							<label for="bbp_stick_topic"><?php _e( 'Topic Type:', 'bbpress' ); ?></label><br />
    
    							<?php bbp_form_topic_type_dropdown(); ?>
    
    						</p>
    
    						<?php do_action( 'bbp_theme_after_topic_form_type' ); ?>
    
    						<?php do_action( 'bbp_theme_before_topic_form_status' ); ?>
    
    						<p>
    
    							<label for="bbp_topic_status"><?php _e( 'Topic Status:', 'bbpress' ); ?></label><br />
    
    							<?php bbp_form_topic_status_dropdown(); ?>
    
    						</p>
    
    						<?php do_action( 'bbp_theme_after_topic_form_status' ); ?>
    
    					<?php endif; ?>
    
    					<?php if ( bbp_is_subscriptions_active() && !bbp_is_anonymous() && ( !bbp_is_topic_edit() || ( bbp_is_topic_edit() && !bbp_is_topic_anonymous() ) ) ) : ?>
    
    						<?php do_action( 'bbp_theme_before_topic_form_subscriptions' ); ?>
    
    						<p>
    							<input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe" <?php bbp_form_topic_subscribed(); ?> tabindex="<?php bbp_tab_index(); ?>" />
    
    							<?php if ( bbp_is_topic_edit() && ( bbp_get_topic_author_id() !== bbp_get_current_user_id() ) ) : ?>
    
    								<label for="bbp_topic_subscription"><?php _e( 'Notify the author of follow-up replies via email', 'bbpress' ); ?></label>
    
    							<?php else : ?>
    
    								<label for="bbp_topic_subscription"><?php _e( 'Notify me of follow-up replies via email', 'bbpress' ); ?></label>
    
    							<?php endif; ?>
    						</p>
    
    						<?php do_action( 'bbp_theme_after_topic_form_subscriptions' ); ?>
    
    					<?php endif; ?>
    
    					<?php if ( bbp_allow_revisions() && bbp_is_topic_edit() ) : ?>
    
    						<?php do_action( 'bbp_theme_before_topic_form_revisions' ); ?>
    
    						<fieldset class="bbp-form">
    							<legend>
    								<input name="bbp_log_topic_edit" id="bbp_log_topic_edit" type="checkbox" value="1" <?php bbp_form_topic_log_edit(); ?> tabindex="<?php bbp_tab_index(); ?>" />
    								<label for="bbp_log_topic_edit"><?php _e( 'Keep a log of this edit:', 'bbpress' ); ?></label><br />
    							</legend>
    
    							<div>
    								<label for="bbp_topic_edit_reason"><?php printf( __( 'Optional reason for editing:', 'bbpress' ), bbp_get_current_user_name() ); ?></label><br />
    								<input type="text" value="<?php bbp_form_topic_edit_reason(); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_topic_edit_reason" id="bbp_topic_edit_reason" />
    							</div>
    						</fieldset>
    
    						<?php do_action( 'bbp_theme_after_topic_form_revisions' ); ?>
    
    					<?php endif; ?>
    
    					<?php do_action( 'bbp_theme_before_topic_form_submit_wrapper' ); ?>
    
    					<div class="bbp-submit-wrapper">
    
    						<?php do_action( 'bbp_theme_before_topic_form_submit_button' ); ?>
    
    						<button type="submit" tabindex="<?php bbp_tab_index(); ?>" id="bbp_topic_submit" name="bbp_topic_submit" class="button submit"><?php _e( 'Submit', 'bbpress' ); ?></button>
    
    						<?php do_action( 'bbp_theme_after_topic_form_submit_button' ); ?>
    
    					</div>
    
    					<?php do_action( 'bbp_theme_after_topic_form_submit_wrapper' ); ?>
    
    				</div>
    
    				<?php bbp_topic_form_fields(); ?>
    
    			</fieldset>
    
    			<?php do_action( 'bbp_theme_after_topic_form' ); ?>
    
    		</form>
    	</div>
    
    <?php elseif ( bbp_is_forum_closed() ) : ?>
    
    	<div id="no-topic-<?php bbp_topic_id(); ?>" class="bbp-no-topic">
    		<div class="bbp-template-notice">
    			<p><?php printf( __( 'The forum ‘%s’ is closed to new topics and replies.', 'bbpress' ), bbp_get_forum_title() ); ?></p>
    		</div>
    	</div>
    
    <?php else : ?>
    
    	<div id="no-topic-<?php bbp_topic_id(); ?>" class="bbp-no-topic">
    		<div class="bbp-template-notice">
    			<p>
    				<?php
    				if(is_user_logged_in()) {
    					_e( 'You cannot create new topics.', 'bbpress' );
    				} else {
    					echo esc_html__( 'You must be logged in to create new topics.', 'bbpress' ) . ' <a href="' . esc_url( thim_get_login_page_url() ) . '">' . esc_html__( 'Login here', 'bbpress' ) . '</a>';
    				}
    				?>
    			</p>
    		</div>
    	</div>
    
    <?php endif; ?>
    
    <?php if ( !bbp_is_single_forum() ) : ?>
    
    </div>
    
    <?php endif; ?>
    

    Robin W
    Moderator

    @robin-w

    ok, the line

    echo esc_html__( 'You must be logged in to create new topics.', 'bbpress' ) . ' <a href="' . esc_url( thim_get_login_page_url() ) . '">' . esc_html__( 'Login here', 'bbpress' ) . '</a>';

    is doing the Login Here

    This line chooses the location from a setting in your theme thim_get_login_page_url()

    so I suspect it is as simple as changing that setting to the page you want it to say, so look at your theme settings

    If that doesn’t work, come back

Viewing 13 replies - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.
Skip to toolbar