Theme Author
Tom
(@edge22)
Hi there,
Anything is possible. Would this be a menu item added dynamically based on whether the user is logged in or not?
Thanks Tom.
Yes, i have two roles; user and vendor, which should have two different dybamic menus, maybe even different appearences.
Specific for the user role i want the give the user access to my services when they are logged in. The custom dynamic menu should be visible when visiting pages with services when they are logged in, maybe even on all pages, so it would somehow be in a sidebar og below main menu or similar.
For vendor role im not conpletly sure how to structure it yet, but im thinking something similar to the user but only for some specific pages.
Theme Author
Tom
(@edge22)
It depends where you want it to display, but you can get the current users role like this:
if ( is_user_logged_in() ) {
$user = wp_get_current_user();
$role = '';
if ( $user->roles ) {
$role = $user->roles[0];
}
if ( 'role-to-check' === $role ) {
echo 'Display a message';
}
}
So that will grab the first available role assigned to the user, and display a message if it matches whatever you’re checking (role-to-check) in the example.
Where exactly do you want to display the link? I can help with that as well 🙂
Just bought GP premium since i were planning on using the theme before these questions. Gonna do a full from another theme next week.
But lets keep it here for now.
It seems like the simple method above could be a Way to go, but let me explain in a bit more details.
The dashboard is the first page the user gets directed to. The dashboard should show user informations, like status on tasks completed in a checklist, budget, and how much spended so far and other profiler info etc on mydomain.com/dashboard. You get the picture. Could it be achived with secondary menu? Havent researched that much yet on whats possible with GP.
Just bought GP premium since i were planning on using the theme before these questions. Gonna do a full from another theme next week.
But lets keep it here for now.
It seems like the simple method above could be a Way to go, but let me explain in a bit more details.
The dashboard is the first page the user gets directed to. The dashboard should show user informations, like status on tasks completed in a checklist, budget, and how much spended so far and other profiler info etc on mydomain.com/dashboard. You get the picture. Could it be achived with secondary menu? Havent researched that much yet on whats possible with GP.
Theme Author
Tom
(@edge22)
The theme itself is just the foundation to your site, so anything is possible, but custom solutions like this definitely aren’t built in.
How is the actual Dashboard being created? Using a plugin?