Add Blog Categories into BuddyPress Social Theme menu in next release

Can you add Blog Categories into BuddyPress Social Theme menu in next release?? The same way like http://buddypressthemes.org/theme-preview/BuddyPress+Magazine+Theme/

  • Tammie
    • WordPress Wizard

    @vietlinked: I've not tested it however if you do these steps it should work.

    1. Make sure you are using the child / parent theme version of Bp Social. I suggest this so you can futureproof for upgrades.
    2. Copy top-bar.php into the child theme
    3. Go to line 35 this is the start of the navigation. You can now put the navigation code anywhere in the lists (there are a few to show different menus depending on things. I'd suggest perhaps placing it after the blogs bit is easier. This is at line 62 and then again at line 89.

    <?php if ( function_exists( 'bp_blogs_install' ) ) : ?>
    <li<?php if ( bp_is_page( BP_BLOGS_SLUG ) ) : ?> class="selected"<?php endif; ?>>/<?php echo BP_BLOGS_SLUG ?>" title="<?php _e( 'Blogs', 'buddypress' ) ?>"><?php _e( 'Blogs', 'buddypress' ) ?>
    <?php endif; ?>

    4. After the
    <?php endif; ?>
    you see above put the following code:

  • <?php _e( 'Categories', 'buddypress' ) ?>

      <?php wp_list_categories('orderby=name&title_li=');
      $this_category = get_category($cat);
      if (get_categories($thiscategory->cat_ID) != "") {

      wp_list_categories('orderby=id&show_count=0&title_li=
      &use_desc_for_title=1&child_of='.$this_category->cat_ID);

      }
      ?>

  • 5. You may have to play about with the styling and so on but that's the basics to get you on track. You can change things to suit your own version.

  • Tammie
    • WordPress Wizard

    @vietlinked: Rather than sharing the file just put the following at the lines mentioned and it will work just tested for you. Seems my posting before wasn't picking some of the code up so try this. I assume you're not using the child / parent theme?

    1. In top-bar.php put:

    line 66 after:

    insert:

    <li><a href="#"><?php _e( 'Categories', 'buddypress' ) ?></a>
    		<ul>
    		<?php wp_list_categories('orderby=name&title_li=');
    		$this_category = get_category($cat);
    		if (get_categories($thiscategory->cat_ID) != "") {
    
    		wp_list_categories('orderby=id&show_count=0&title_li=
    		&use_desc_for_title=1&child_of='.$this_category->cat_ID);
    
    		}
    		?>
    		</ul>
    		</li>

    2. After line 104 in top-bar.php

    insert:

    <li><a href="#"><?php _e( 'Categories', 'buddypress' ) ?></a>
    		<ul>
    		<?php wp_list_categories('orderby=name&title_li=');
    		$this_category = get_category($cat);
    		if (get_categories($thiscategory->cat_ID) != "") {
    
    		wp_list_categories('orderby=id&show_count=0&title_li=
    		&use_desc_for_title=1&child_of='.$this_category->cat_ID);
    
    		}
    		?>
    		</ul>
    		</li>

    I tested that on the social non child / parent theme and works a charm.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.