Added a new tab but link doesn't work
-
Hi, this has been asked a lot but in the 90% of the cases the requests are left unsolved (not only here but on other forums too).
I created a new tab in the members template and it shows as desired. But when I click on the link it loads a page similar to the members root but without a header. Anyway, it doesn’t matter what it shows. The problem is that it doesn’t show what I expected.
A few considerations:
1) I copied all the member directory to a buddypress directory in my wordpress theme, so it is like this: /wp-content/themes/mytheme/buddypress/members
2) I pasted my code in the functions.php file
3) I’m using BuddyPress 1.8.x
4) I want the content to load inside the members tempalate. Just like a plugin. Sorry, but I can’t provide a link to my site (is a password protected work in progress).
here’s the code:
function my_bp_nav_adder() { bp_core_new_nav_item( array( 'name' => 'My Trips', 'slug' => 'mytrips', 'position' => 75, 'show_for_displayed_user' => true, 'screen_function' => 'my_trips_link', )); } function my_trips_link () { add_action( 'bp_template_content', 'show_content' ); bp_core_load_template( apply_filters('bp_core_template_plugin', 'members/single/plugins' )); } function show_content() { echo 'This is a test'; } add_action( 'bp_setup_nav', 'my_bp_nav_adder' );
Thanks!
Enrique
- The topic ‘Added a new tab but link doesn't work’ is closed to new replies.