"However, the shortcode to insert the appropriate view does not work.
Interestingly, the Firefox page with the user view is empty, while Chrome is old, so "customer" and "dealer" have a view for "dealer"."
It's bad.
Indifferent whether I am logged in or not, whether I am logged (If I'm logged in) in as "administrator", "dealer" or "custor" - the "customer" profile page should ALWAYS display the "customer" view, and the "dealer" profile page should AWAYS display the "dealer" view. Of course I'm talking about the front-end.
Now there is nothing shown (Firefox), or the view for "dealer" (Chrome), whether it is a "customer" or "dealer" page.
hidden link - "customer" page
hidden link - "dealer" page
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
I've added following code to your functions.php file to get the user-type based on author_id.
function func_get_user_type( $atts ){
if(isset($_GET['author_id'])){
$author_id = $_GET['author_id'];
$x = get_user_meta($author_id,'wpcf-user-type',true);
return $x;
}
}
add_shortcode('get_user_type', 'func_get_user_type' );
Now, I've changed the conditional shortcode as given under:
[wpv-conditional if="( '[get_user_type]' eq '1' )"]
[wpv-view name="profil-customer"]
[/wpv-conditional]
[wpv-conditional if="( '[get_user_type]' eq '2' )"]
[wpv-view name="profil-dealera"]
[/wpv-conditional]
Also - I've registered the shortcode [get_user_type] at:
=> Toolsset => Settings => Frontend content => Third-party shortcode arguments
Now - when you try to load the both profile - it works fine:
=> hidden link
=> hidden link
You are great! Thanks alot! 🙂
"Now - Could you please share problem URL where above conditional shortcode not working."
As for the address - I would like in the address bar instead of "? Author_id = 123" was the nickname of the user whose profile is shown on the page.
So instead of:
hidden link
should:
hidden link
Or even better:
hidden link
But I do not know if this is possible ...
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
As I fixed almost all the issues for you and your original issue is resolved.
May I kindly ask you to open a new ticket for your each new question. This will help other users searching on the forum.
Thank you for understanding and have a great day ahead.
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Also - I'm closing the day here. Please kindly open a new ticket so you will get help with your issue.
Yes, of course.
I even wondered how you wrote: "Now - Could you please share problem URL where above conditional shortcode not working."
I thought that I wanted this topic in this thread to solve.
I will create a new topic.
Thanks again for help.