BuddyDev

Search

[Resolved] Blog categories

Tagged: 

  • Keymaster
    (BuddyDev Team)
    Posts: 21292
    Brajesh Singh on #1468

    Thank you. I will post the code in an hour.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 21292
    Brajesh Singh on #1481

    Hi,
    Here is the code

    
    
    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 ), //CHANGE It with the correct IDs,
    		'orderby'		=> 'slug',
    		'order'			=> 'ASC'
    	);
    	
    	$settings['tax'] = $tax;
    	
    	return $settings;
    }
    

    Please change ids to your allowed categories and It will only list them.
    Hope that helps.

  • Participant
    Level: Enlightened
    Posts: 32
    Terjemk on #1485

    Thats just great! Thanks.

    One question. I tried to put this in functions.php in my child theme without results, but works fine in the function.php in parent theme.

    Why is that?

  • Keymaster
    (BuddyDev Team)
    Posts: 21292
    Brajesh Singh on #1486

    Thank you.

    Putting in child theme’s functions.php should work fine too. Any chance you are on multisite and that child theme is not being used on your current site?

  • Participant
    Level: Enlightened
    Posts: 32
    Terjemk on #1489

    No not using multisite. I`ll try again later to get it to work in my child theme. Prob just me doing something wrong.

You must be logged in to reply to this topic.

This topic is: resolved