viewing user profile on another page
-
Hello. I‘m using free astra theme, elemntor pro, WooCommerce, bbPress and LearnDash in my website.
I’m trying to make a custom “my-account” which comes with woocommerce. and I did using the short code and elementor. but since I’m using bbpress too, I wanted to view the bbpress user profile that’s located by defualt in “example.com/forums/user/******”
what I did: i created a custom endpoint “/my-account/forums/” and since I wanted the dynamic content. i thought i can use the templates of bbpress. so I added code #1 in my theme functions.php and copied the code of user-profile.php from the bbpress templates into my forums.php that i created in astea/WooCommerce/myaccount/
code #1
`function my_custom_endpoint_content() {
include ‘woocommerce/myaccount/forums.php’;
}
add_action( ‘woocommerce_account_forums_endpoint’, ‘my_custom_endpoint_content’ );what happened: it showed the content, but it views the data of a normal vistor – non-logged in user- instead of pulling the current user.
so any ideas on how to achieve such a thing ? maybe there is a another method that’s not even related to what I’m trying to do ?
- You must be logged in to reply to this topic.