Skip Navigation

[Resolved] User's page on frotend

This support ticket is created 7 years, 1 month 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 12 replies, has 2 voices.

Last updated by talitaL 7 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#487334

Hi.. I've created a list of all users (members) registered in my site, and I'd like that when click on them, go to a page with all info about this specific user, and its posts.
(Not necessarily be logged in. Anyone can see.)

See this list here: hidden link

I've created roles, users fields, but I really cant' find how to create this member page and show it in frontend. Is it with Views?
How to vinculate the infos with the selected user (member) ID?

And also, I don't know how to set the link from the previous list to redirect to this user page.. (now I'm use something like code below , but I'm pretty sure that it's not gonna work)...

<a href="page-name.php?id=[wpv-user field='ID']" target="_blank">[types usermeta='foto' size='thumbnail' align='none' resize='crop' user_is_author='true'][/types]</a>

Please, please, help-me!
Thank you!

#487446

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

We have complete guidance available with our Docs about creating user profiles:
=> https://toolset.com/documentation/customizing-sites-using-php/creating-custom-user-profiles/

#489771

I'm sorry, I've read the entire tutorial you send me, but still can't find a way to show and customize the author's page.

As I've written in my first question, I've already created Custom User Profiles (which is the first part of your tutorial).

And about the author.php page... my theme didn't have one, so I've created one, exactly the Example for author archive template (offered in same tutorial).

What about now?? How can I customize it using the toolset fields and posts?
Should I do it direct in the php code? (Plz tell me not)

And if not, should I create a View? A Template? I've tried all these options, but didn't work out... 🙁

#489831

Minesh
Supporter

Languages: English (English )

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

Can I have info what content you want to dispaly with your user profiles? I need to check on your install how you setup your user profile fields etc..etc..

Can I've problem URL?

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#490007

Minesh
Supporter

Languages: English (English )

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

Well - when you say:
They supposed to have access just to Post types: "Cães" and "Ninhadas", and their own user profile info.
==> You can use Access here to control your post types.

Please check following.
=> https://toolset.com/documentation/user-guides/setting-access-control/

=> What information you want to hide/show? Cant you able to manage with Access?
=> What is your flow to show/hide the content?

#490027

Yes.. I know about Access control! This was already done! It's everything OK with this part!

=> What information you want to hide/show? Cant you able to manage with Access?
=> What is your flow to show/hide the content?

I want the autor's page show all it's special user fields, and all it's posts type 'Cães' and 'Ninhadas' (just of this author).

For example: When I click on the name or photo of an user of the list (from the link in previous message), I can see the author's page (which URL is
hidden link).

I've made an example here, of what I expect to see on author's page:
hidden link
(This page is just an example, in this case it just works for the author of the page, but I want to display something like that on author's page).

I can manage the layout, but can't put the correct fields on the author.php file. Besides, the author.php page only works for administrator, but don't for the users created with Toolset (Sócio Criador, Sócio Proprietário and Sócio Simpatizante).
See:
hidden link (my user - Admin)
hidden link (example user - Sócio Criador)

#490344

Minesh
Supporter

Languages: English (English )

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

Thanks for the info. Lets divide your problem into small parts so we can easily deal with that.

I checked the page that you shared and you want to display following:

Here will get the list (View) of all Posts Type "Cães" (just of the author above).
Here will get the list (View) of all Posts Type "Ninhadas" (just of the author above).

I see that you also have created the views for above things.

So - you just need to filter your view by post author. You should add query filter from your edit view.
=> https://toolset.com/documentation/user-guides/filtering-views-query-by-author/

Add filter by post author query filter to both of your views:
=> hidden link
=> hidden link

Then - as you are using PHP template to dispaly the author info. You can use views API to dispaly the above views with your PHP author.php template file:
=> https://toolset.com/documentation/user-guides/views-api/

Could you please confirm that you able to add the view to your php template and its displaying infos.

#490725

Hi Minesh!
Thank you for your patience and tips.
I'm making some progress here. 🙂

OK.. so I've created 3 views and add them on author.php page using API.

I also added filter by author (by URL - username - and parameter: user_login) in each one of the views.

Two problems occur:

1) When page url have my own username (tallieven), which is admin, all profiles and posts are displayed.
I guess probably I've set something wrong with filter.
(See here: hidden link)

2) When page url have other username, the page returns empty:
(hidden link)

Can you help-me with this?
Thanks again.

#491281

Minesh
Supporter

Languages: English (English )

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

Well - now you can see the data on your page:
=> hidden link

I see you have added multiple views to your profile page. You should correct your view filters to display data accordingly.

#491519
author-filter.jpg
author-page.jpg

Something still is wrong with filter.. :'(
Only the user selected by URL (and it's posts) should be displayed at current author's page (look the image attached)

I've tryed a lot of combinations on filter settings, but still not working.

What is wrong? Could you please correct it for me?

#491610

Minesh
Supporter

Languages: English (English )

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

Well - I see that you've added multiple view's to author.php file. Which view should I use?

I request you to remove unwanted views from file and I will try to take next steps.

#491862

Minesh
Supporter

Languages: English (English )

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

Thanks for the infos. I've modified your author.php file as follows:

 <?php

  $args = array(
    'name' => 'perfil-de-associado',
	'id'=>963,
	'users'=>get_queried_object_id()
	);
	echo render_view( $args );

 ?>

<h4>Cães do Plantel deste Socio</h4><br/>
<!-- View (Cães por Autor) = Caes by author -->
 <?php
  $args = array(
    'name' => 'caes-por-autor',
	'author'=>get_queried_object_id()
	);
	echo render_view( $args );
 ?>

<h4>Ninhadas deste Socio</h4><br/>
 <!-- View (Ninhadas por Autor) = Ninhadas by author -->
  <?php
  $args = array(
    'name' => 'ninhadas-por-autor',
	'author'=>get_queried_object_id()
	/* 'orderby' => 'field-data-de-nascimento-da-ninhada' */
	
	);
	echo render_view( $args );
 ?>

I passed current author id to each view using get_queried_object_id() function and also change filter of your each view. You should check your view's query filters as well and now I can see on your author.php file will display information related to your current author page.

#492162

Yesss! 😀 Thank you very much Minesh!

I had to set ID for 'Caes' and 'Ninhada' Views (just as you've done with Users View), and then it works perfectly!

I'm so relieved now! Thank you again!

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