What's the dynamic link for profiles?
Quote from Lexiture on August 8, 2020, 7:14 pmHello.
I’m using a Wordpress theme which has a logged in modal.
I know how to link the “Profile” in BuddyPress and bbpress, but not asgaros.
Could you provide me the correct code for users to access their pertinent asgaros forum profile directly?
Here’s an example of the placeholder links.
function my_custom_lwa_links() { ?> <div class="lwa-a"><a href="https://some-link.com">Some Link Title</a></div> <div class="lwa-a"><a href="https://another-link.com">Some Second Link Title</a></div> <?php } add_action( "zeen_logged_in", "my_custom_lwa_links" );Thanks in advance.
Hello.
I’m using a Wordpress theme which has a logged in modal.

I know how to link the “Profile” in BuddyPress and bbpress, but not asgaros.
Could you provide me the correct code for users to access their pertinent asgaros forum profile directly?
Here’s an example of the placeholder links.
function my_custom_lwa_links() {
?>
<div class="lwa-a"><a href="https://some-link.com">Some Link Title</a></div>
<div class="lwa-a"><a href="https://another-link.com">Some Second Link Title</a></div>
<?php
}
add_action( "zeen_logged_in", "my_custom_lwa_links" );
Thanks in advance.
Quote from qualmy91 on August 11, 2020, 6:07 amHey @lexiture,
the structure of the URL of the profile from Asgaros Forum is
https://yourdomain.com/forum/profile/user-nicename
“forum” is the slug of the page where you added the Forum shortcode
“user-nicename” is the nicename of the WordPress user
You can get the nicename of the current user by using the following code:
$nicename = wp_get_current_user()->user_nicename;
Hey @lexiture,
the structure of the URL of the profile from Asgaros Forum is
https://yourdomain.com/forum/profile/user-nicename
“forum” is the slug of the page where you added the Forum shortcode
“user-nicename” is the nicename of the WordPress user
You can get the nicename of the current user by using the following code:
$nicename = wp_get_current_user()->user_nicename;
Quote from Lexiture on August 13, 2020, 12:00 amQuote from qualmy91 on August 11, 2020, 6:07 amHey @lexiture,
the structure of the URL of the profile from Asgaros Forum is
https://yourdomain.com/forum/profile/user-nicename
“forum” is the slug of the page where you added the Forum shortcode
“user-nicename” is the nicename of the WordPress user
You can get the nicename of the current user by using the following code:
$nicename = wp_get_current_user()->user_nicename;
Thanks for your response. The theme author provided me the following code:
function my_custom_lwa_links() { ?> <div class="lwa-a"><?php plugin_function_to_get_dynamic_link(); ?></div> <div class="lwa-a"><a href="https://another-link.com">Some Second Link Title</a></div> <?php } add_action( "zeen_logged_in", "my_custom_lwa_links" );plugin_function_to_get_dynamic_link() it’s what I need. Unfortunately when I put
$nicename = wp_get_current_user()->user_nicename;Nothing happens, is it the function to get the dynamic link?
Thanks.
Quote from qualmy91 on August 11, 2020, 6:07 amHey @lexiture,
the structure of the URL of the profile from Asgaros Forum is
https://yourdomain.com/forum/profile/user-nicename
“forum” is the slug of the page where you added the Forum shortcode
“user-nicename” is the nicename of the WordPress user
You can get the nicename of the current user by using the following code:
$nicename = wp_get_current_user()->user_nicename;
Thanks for your response. The theme author provided me the following code:
function my_custom_lwa_links() {
?>
<div class="lwa-a"><?php plugin_function_to_get_dynamic_link(); ?></div>
<div class="lwa-a"><a href="https://another-link.com">Some Second Link Title</a></div>
<?php
}
add_action( "zeen_logged_in", "my_custom_lwa_links" );
plugin_function_to_get_dynamic_link() it’s what I need. Unfortunately when I put
$nicename = wp_get_current_user()->user_nicename;
Nothing happens, is it the function to get the dynamic link?
Thanks.
Quote from qualmy91 on August 13, 2020, 5:42 amHey @lexiture,
the given function only returns the nicename, that is part of the link.
The following code will only wok if the slug for your Forum Page is ‘forum’. You have to change this in line 7 if you are using another page for the forum.
function my_custom_lwa_links() { // Get nicename of current user $nicename = wp_get_current_user()->user_nicename; // Generate Profile URL $profile_url = site_url() . '/forum/profile/'. $nicename; echo '<div class="lwa-a"><a href="'. $profile_url .'"></a></div>'; // Add another link by using the echo function // echo '<<Link>>'; echo '<div class="lwa-a"><a href="https://another-link.com">Some Second Link Title</a></div>'; } add_action( "zeen_logged_in", "my_custom_lwa_links" );
Hey @lexiture,
the given function only returns the nicename, that is part of the link.
The following code will only wok if the slug for your Forum Page is ‘forum’. You have to change this in line 7 if you are using another page for the forum.
function my_custom_lwa_links() {
// Get nicename of current user
$nicename = wp_get_current_user()->user_nicename;
// Generate Profile URL
$profile_url = site_url() . '/forum/profile/'. $nicename;
echo '<div class="lwa-a"><a href="'. $profile_url .'"></a></div>';
// Add another link by using the echo function
// echo '<<Link>>';
echo '<div class="lwa-a"><a href="https://another-link.com">Some Second Link Title</a></div>';
}
add_action( "zeen_logged_in", "my_custom_lwa_links" );
Quote from Lexiture on August 13, 2020, 10:27 amQuote from qualmy91 on August 13, 2020, 5:42 amHey @lexiture,
the given function only returns the nicename, that is part of the link.
The following code will only wok if the slug for your Forum Page is ‘forum’. You have to change this in line 7 if you are using another page for the forum.
function my_custom_lwa_links() { // Get nicename of current user $nicename = wp_get_current_user()->user_nicename; // Generate Profile URL $profile_url = site_url() . '/forum/profile/'. $nicename; echo '<div class="lwa-a"><a href="'. $profile_url .'"></a></div>'; // Add another link by using the echo function // echo '<<Link>>'; echo '<div class="lwa-a"><a href="https://another-link.com">Some Second Link Title</a></div>'; } add_action( "zeen_logged_in", "my_custom_lwa_links" );
Thank you. It works.
Quote from qualmy91 on August 13, 2020, 5:42 amHey @lexiture,
the given function only returns the nicename, that is part of the link.
The following code will only wok if the slug for your Forum Page is ‘forum’. You have to change this in line 7 if you are using another page for the forum.
function my_custom_lwa_links() { // Get nicename of current user $nicename = wp_get_current_user()->user_nicename; // Generate Profile URL $profile_url = site_url() . '/forum/profile/'. $nicename; echo '<div class="lwa-a"><a href="'. $profile_url .'"></a></div>'; // Add another link by using the echo function // echo '<<Link>>'; echo '<div class="lwa-a"><a href="https://another-link.com">Some Second Link Title</a></div>'; } add_action( "zeen_logged_in", "my_custom_lwa_links" );
Thank you. It works.
