Skip to:
Content
Pages
Categories
Search
Top
Bottom

How can I hide category when create a new topic?


  • Rety
    Participant

    @psycocandy

    It’s possible to hide the category when create a new topic and let set a fixed single category?

    Thanks!

    Versão 4.2.3

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

  • Robkk
    Moderator

    @robkk

    The category slug? Can you please explain a little more about this?


    PinkishHue
    Participant

    @pinkishhue

    I’m assuming by category you mean the forum that the topic is in?

    You can remove the forum dropdown menu and use a hidden field here instead.

    In your theme you need to have this file:

    wp-content/your-theme/bbpress/form-topic.php

    If you don’t have it, copy it over from the bbpress default templates at:

    wp-content/plugins/bbpress/templates/default/bbpress

    Then open your new form-topic.php in a text editor and find this part of the code:

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

    and replace it with this:

    <input id="bbp_forum_id" type="hidden" name="bbp_forum_id" value="20">

    Where 20 is the ID no. of the forum you want all topics to be created in.

    Hope that helps 🙂

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