Skip Navigation

[Resolved] Link depends on the author's entry.

This support ticket is created 7 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by Bochnacki 7 years, 8 months ago.

Assisted by: Minesh.

Author
Posts
#483277

I have created two types of pages the author: one for the 'customer' and one for the 'dealer'.
How to create a link in the list of entries depending on the author entry?
If the author of entry is 'customer' visible link to the 'customer page', and if author of entry is 'dealer' a link to the 'dealer page'.

Thanks in advance for help 🙂

#483488

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

As I understand 'customer' and 'dealer' is setup as custom role. What if you try to use view's conditional statement:

For example:

[wpv-conditional if="( '[wpv-current-user info='role']' eq 'your_custom_role' )"]
your conditional stuff here
[/wpv-conditional]

If you want to check author info:

[wpv-conditional if="( 'wpv-post-author]' eq 'your_author_name' )"]
your conditional stuff here
[/wpv-conditional]

More info:
=> https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-author
=> https://toolset.com/documentation/user-guides/conditional-html-output-in-views/

Even you can also filter view by author:
=> https://toolset.com/documentation/user-guides/filtering-views-query-by-author/

#483546

Unfortunately, both solutions are bad.
The first defines the role of the user browsing the page and not the author of the post, the second requires a specific author's name (I can not predict).
Filter by author - I understand that you must first create an additional view with links to the sites of authors and insert them in the loop, which also needs to be done in two versions - one for the 'customer', one for 'dealer', right?
The ideal solution would be a shortcode [wpv-conditional if = "(" wpv-post-author info = 'role'] 'eq' dealer ') "] but it does not work 🙁

#483559

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Filter by author - I understand that you must first create an additional view with links to the sites of authors and insert them in the loop, which also needs to be done in two versions - one for the 'customer', one for 'dealer', right?
==> Yes - correct. you should create two separate views.

The ideal solution would be a shortcode [wpv-conditional if = "(" wpv-post-author info = 'role'] 'eq' dealer ') "] but it does not work.
=> Well - author meda does not contain role. You can see with WordPress codex with the following link no "role" field is available for author meta.
=> https://codex.wordpress.org/Function_Reference/the_author_meta

#483566

Thanks for the answer.

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.