Tagged: buddyblog
Hi Van,
Welcome to BuddyDev support forums.BuddyBlog posts are normal blog posts and you can use any of the WordPress post listing plugin/shortcode for this purpose.
Regards
BrajeshHi Van,
Yes, you may do so.
Are you using BuddyBlog or BuddyBlog pro? We can provide more specific assistance if you can let us know.Regards
BrajeshThank you.
You may use this code snippet(and update the include ids) to limit which categories the user can post.https://buddydev.com/support/forums/topic/blog-categories/page/2/#post-1481
Regards
BrajeshSorry, but i dont understand what i need change in this code if i need only one category for blogs?
add_filter( ‘buddyblog_post_form_settings’, ‘buddyblog_show_custom_cats’, 100 );
function buddyblog_show_custom_cats( $settings ) {
$tax = array();$tax[‘category’] = array(
‘taxonomy’ => ‘category’,
‘view_type’ => ‘checkbox’,
‘include’ => array( 1, 35,97 ),
‘orderby’ => ‘slug’,
‘order’ => ‘ASC’
);$settings[‘tax’] = $tax;
return $settings;
}- This reply was modified 1 year, 7 months ago by Van.
Hi Van,
You will need to change this line'include' => array( 1, 35,97 ),
Assuming that your category id is 25, it can bewritten as
'include' => array( 25 ),
Regards
BrajeshMaybe I’m doing something wrong. I have created a new category “Blogs”. In the link, her id is 31. And then I specified 31 in your code, which I added to the site. After that, I tried to publish a blog entry, but it was published not in “blogs”, but in the “news” section.
Hello Van,
Thank you for the acknowledgment. Is your category seeing on user posting form?. Please check the following link:
Also, Make sure your code is same as the following one.
add_filter( 'buddyblog_post_form_settings', 'buddyblog_show_custom_cats', 100 ); function buddyblog_show_custom_cats( $settings ) { $tax = array(); $tax['category'] = array( 'taxonomy' => 'category', 'view_type' => 'checkbox', 'include' => array( 31 ), //Your category id, 'orderby' => 'slug', 'order' => 'ASC' ); $settings['tax'] = $tax; return $settings; }
Regards
Ravi
You must be logged in to reply to this topic.