BuddyDev

Search

Shortcode for Buddyblog

Tagged: 

  • Participant
    Level: Initiated
    Posts: 11
    Van on #48995

    Hello. How can I create a new page and display a feed of blog updates for all users there? Maybe there is some kind of shortcut or other ways?

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #49018

    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
    Brajesh

  • Participant
    Level: Initiated
    Posts: 11
    Van on #49063

    Please explain, can I create, for example, a “blogs” category and that by default all blog entries are published only in this category?

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #49064

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

  • Participant
    Level: Initiated
    Posts: 11
    Van on #49065

    BuddyBlog

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #49066

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

  • Participant
    Level: Initiated
    Posts: 11
    Van on #49067

    Sorry, 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 ago by Van.
  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #49070

    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
    Brajesh

  • Participant
    Level: Initiated
    Posts: 11
    Van on #49096

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

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2934
    Ravi on #49100

    Hello Van,

    Thank you for the acknowledgment. Is your category seeing on user posting form?. Please check the following link:

    https://tinyurl.com/2hsdd8yz

    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.

This topic is: not resolved