Hi there,
Awesome work that you’re doing here!
I am a bit of a noob when it comes to custom code, so please bare with me, I need some help.
I would like to change the field “blog” to another word, and I would also like to create a sub-menu of site categories under the user’s blog field.
Also, how would I change certain fields in BuddyPress? For example, instead of “New Post” I want to change it to “Publish” and so forth.
Best regards
Skryf_Net
Hi Skryfnet,
Welcome to Buddydev. If You are familiar with translation you can modify it from the .po file and use the following code in you bp-custom.php file to list the site categories
function buddydev_site_categories_tab() { $bp = buddypress(); $user_url = bp_loggedin_user_domain(); bp_core_new_subnav_item( array( 'name' => __('Site Categories'), 'slug' => 'categories', 'parent_url' => trailingslashit( $user_url . $bp->buddyblog->slug ), 'parent_slug' => $bp->buddyblog->slug, 'screen_function' => 'buddydev_screen_site_categories', 'position' => 30, ) ); } add_action( 'bp_setup_nav', 'buddydev_site_categories_tab', 100 ); function buddydev_screen_site_categories() { add_action( 'bp_template_content', 'buddydev_render_site_categories_content' ); bp_core_load_template( array( 'members/single/plugins' ) ); } function buddydev_render_site_categories_content() { wp_list_categories(array( 'hide_empty' => false )); }
Thank You
RaviHi there! Thank you for the help. However, I copied the above code into the file, yet nothing appeared to have happened. Could I have done something wrong?
For example, when the user hovers over the “blog” field (added by BuddyBlog) I need a drop down list of the word press categories to appear, or a submenu of categories, so that when the user creates a “new post” that post will not only appear on the wordpress main site, but also as a link under the correct category in the “blog” field
With regards to .po files, I can’t seem to find the correct place to change the field “blog” that was added by BoddyBlog to a custom word “skryfwerk” which is ducth for “written work.”
Hope it is not to much to ask, I am still in the learning process.
Much appreciated
skryfnet
Hi there, I have tried it a few times, here is the complete code. Am I doing it right?
<?php function buddydev_site_categories_tab() { $bp = buddypress(); $user_url = bp_loggedin_user_domain(); bp_core_new_subnav_item( array( 'name' => __('Site Categories'), 'slug' => 'categories', 'parent_url' => trailingslashit( $user_url . $bp->buddyblog->slug ), 'parent_slug' => $bp->buddyblog->slug, 'screen_function' => 'buddydev_screen_site_categories', 'position' => 30, ) ); } add_action( 'bp_setup_nav', 'buddydev_site_categories_tab', 100 ); function buddydev_screen_site_categories() { add_action( 'bp_template_content', 'buddydev_render_site_categories_content' ); bp_core_load_template( array( 'members/single/plugins' ) ); } function buddydev_render_site_categories_content() { wp_list_categories(array( 'hide_empty' => false )); } ?>
Thank you for your patience
Excuse me, the above code is working now, though not as I had anticipated (in a drop menu) but it would definitely do for now! Thanks a lot.
It seems the issue now, for me is translating, as the code is in conflict with the site language. I will move that question to a new post.
Thanks a lot for your patience and help.
You must be logged in to reply to this topic.