Skip to:
Content
Pages
Categories
Search
Top
Bottom

Set default forum when creating new topics in bbPress


  • elpju
    Participant

    @elpju

    As the title says, is it possible to select a default forum that is set when people create a new topic? The thing is I only have ONE forum and it’s just crazy that people have to choose it before being able to post.

    Right now the default choice is (No Forum) and when you click Submit with No Forum posted, you get this: ERROR: Forum ID is missing.

    Hope some bright mind comes along and sees this post.

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

  • Unit9
    Participant

    @unit9

    I’d like this too. For some reason there was a default in my previous bbpress site, but in the latest installation, I have ‘No Forum’ selected.

    Any way we can change this?


    elpju
    Participant

    @elpju

    This is exactly what I’m talking about. I also remember having a default forum in a previous version of the bbPress plugin, but this may just be wishful thinking.


    Unit9
    Participant

    @unit9

    Yep – I’ve just installed an old version of BBPress and it’s working – I’ve got a default forum again.

    It’s also fixed the bug where page meta titles don’t work on WordPress blog posts.


    elpju
    Participant

    @elpju

    I told them about those titles a month ago and thought it would have been fixed by now. It’s a pretty serious problem if you rely on traffic from the search engines.

    [bbp-topic-form forum_id=$forum_id] – Display the ‘New Topic Form’ for a specific forum ID
    https://codex.bbpress.org/shortcodes/

    So if the forum you want has an ID of 341 use [bbp-topic-form forum_id=341]


    hotconductor
    Participant

    @hotconductor

    Right Stephen, but that doesn’t change the default form that gets embedded on each forum index page.


    Robkk
    Moderator

    @robkk

    @hotconductor

    Thats just a shortcode that you put in a separate page, not the topic form being displayed below forums using the form-topic.php template.


    hotconductor
    Participant

    @hotconductor

    Right. I am curious, like the original poster, about setting a default forum instead of having (no forum) as the default. People compose posts, without selecting a forum… it kicks back an error, no one gets it. I’d rather have it set by default to a general category, and the dropdown is there for seasoned users. Makes no sense that it is set as (no forum) by default, especially for folks who only have a single forum.

    Is there a way to change the default from (no forum) to forum1/etc?


    Robkk
    Moderator

    @robkk

    For having a forum show up instead of the (No Forum), copy form-topic.php in your child theme.

    In the code toward line 109 you would see something like this.

    <?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; ?>

    Remove 'show_none' => __( '(No Forum)', 'bbpress' ), so it would look like this.

    <?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(
    				'selected'  => bbp_get_form_topic_forum()
    				) );
    			?>
    	</p>
    
    <?php do_action( 'bbp_theme_after_topic_form_forum' ); ?>
    
    <?php endif; ?>

    The default forum shown is whatever is first in the forum index page. It either is sorted by publish date first or the forum ordered first if you manually changed the forum order by editing the forum.


    JijOnline
    Participant

    @jijonline

    Awesome! Thnx!

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