Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #729424

    truth5212
    Participant

    Dear admin,

    Is there a way to customize or change the header texts for bbpress “create a new topic” pages as shown in the picture?

    Link of the page is here

    Thanks!

    #729451

    Christopher
    Moderator

    Hey there,

    I would like to check your site but it asks me to login to create a topic.
    Please provide us with login credentials.

    Thanks.

    #729484

    truth5212
    Participant
    This reply has been marked as private.
    #729499

    Thai
    Moderator

    Hi There,

    Try adding following CSS under Customize > Custom > CSS:

    .page-id-716 #new-post fieldset.bbp-form legend {
        color: #f0f0f0;
        font-size: 28px;
    }
    .page-id-716 #new-post > fieldset > div:nth-child(3) > p:nth-child(1) > label {
        color: #f0f0f0;
        font-size: 28px;
    }

    Hope it helps.

    #729515

    truth5212
    Participant

    Hi there!

    I think i did not explain clearly, what I wanted to do was to change the default text of “Create New Topic in “Wishing well” to something else like “whisper a wish” and not to change the font effects or color of the letters.

    Thank you so so much!

    #729521

    Thai
    Moderator

    Hi There,

    Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
    Then navigate to your child theme’s directory create a new file named /bbpress/form-topic.php(create a new folder named bbpress also) a file named and paste the code below:

    <?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_current_user_can_access_create_topic_form() ) : ?>
    
    	<div id="new-topic-<?php bbp_topic_id(); ?>" class="bbp-topic-form x-bbp-general-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' ); ?>
    
    						<p>
    							<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 />
    						</p>
    
    						<p>
    							<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" />
    						</p>
    
    						<?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 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 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 is_user_logged_in() ? _e( 'You cannot create new topics.', 'bbpress' ) : _e( 'You must be logged in to create new topics.', 'bbpress' ); ?></p>
    		</div>
    	</div>
    
    <?php endif; ?>
    
    <?php if ( !bbp_is_single_forum() ) : ?>
    
    </div>
    
    <?php endif; ?>
    

    After that you can edit the texts:

    Create New Topic in &ldquo;%s&rdquo;

    Topic Title (Maximum Length: %d):

    Hope it helps!

    #729533

    truth5212
    Participant

    Hi,

    I am really bad at this, but i thought i have uploaded the child theme into wordpress. Not sure if you mentioned child theme out of caution or is it because I didnt set up one.

    Just to clarify, so the content.php file will be inside this new folder called “bbpress” which i created right?

    I will tell you the outcome of this! Thanks!

    Cheers,
    Jon

    #729543

    Thai
    Moderator

    Hi Jon,

    Sorry for the confusion!

    The file name should be form-topic.php and inside the bbpress folder.

    Regards!

    #729544

    truth5212
    Participant
    This reply has been marked as private.
    #729548

    Thai
    Moderator

    Hi Jon,

    Please rename the content.php file to form-topic.php.

    Let us know how it goes!

    #729554

    truth5212
    Participant

    Worked like a charm!!

    I have always been so afraid to go down to the basics when it comes to coding. You saved my life!!!! Would it be tough on you if you posted how exactly you solved the problem to teach newbies like me to learn to fish instead of getting the fish with help all the time.

    Thank you so much!!!

    #729857

    Rad
    Moderator

    Hi there,

    You’ll just to create the template for the topic, and since you have content.php that can act as a topic template too. Then all you need is duplicate and rename it.

    Thanks.