Hi,
Please try this snippet:
function ps_setup_nav() {
global $bp;
bp_core_new_nav_item( array(
'name' => __( 'My Account', 'buddypress' ),
'slug' => 'my-account',
'position' => 30,
'screen_function' => 'ps_account_page',
) );
}
add_action( 'bp_setup_nav', 'ps_setup_nav' );
function ps_account_page() {
add_action( 'bp_template_content', 'ps_account_content' );
bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
}
function ps_account_content(){
echo do_shortcode('[woocommerce_my_account]'); // If you are using WooCommerce otherwise can write your content instead of thus
}
Hopefully, it will help you.
Thanks
You are so kind @prashantvatsh to help me.
I have implemented this code, and it is not displaying exactly what I want. Is it possible to replace the line
echo do_shortcode('[woocommerce_my_account]');
with an echo of a page URL?
My page URL is “/my-shopping-account/”. Can you help me with this? (Sorry, but I can’t find the right example to follow so I need a bit more help).
Thank you!
That’s why I mentioned if you are using WooCommerce then otherwise not. Which plugin you are using to manage shop and accounts? We can only call the content on profile if they have any shortcode otherwise we can put a link on profile which will redirect to that page.
Thanks
Hi @prashantvatsh
Thank you for getting back to me. I am using WooCommerce, so your code works! (You can ignore my previous question).
Did I say, I really appreciate the support? Many thanks,
Jana
Welcome 🙂
Glad to know that it helped 🙂