Hi there,
I have tried a few plugins and searched this forum for an answer but no luck. The plugins I tried only work on the wp-admin backend and I needed this to work when end-user posts a new post from their buddypress profile.
How can I make the user select only one category when posting? Buttons are currently of type checklist – it would be great if these could be converted to radio or ideally to select with dropdown (I have quite a few categories).
Hello Isabel,
Thank you for posting. Yes, it can be done easily. Please try the following code in your active theme “functions.php” file. It will change checkbox categories to drowndown category.
/** * BuddyBlog Categories as dropdown * * @param array $settings Settings. * * @return array */ function buddydev_buddyblog_categories_as_dropdown( $settings ) { if ( empty( $settings['tax'] ) ) { return $settings; } foreach ( $settings['tax'] as $taxonomy => $detail ) { $settings['tax'][$taxonomy]['view_type'] = 'dd'; } return $settings; } add_filter( 'buddyblog_post_form_settings', 'buddydev_buddyblog_categories_as_dropdown' );
Please let me know if that works or not.
Regards
Ravi
The topic ‘ [Resolved] Buddyblog – allow user to select only one category when posting’ is closed to new replies.