Best approach to create a user direction, both archive and single template?

Hi, so currently I’m working to build a community / social media platform with Cwicly. Does anyone know what’s the best approach for me to create an Archive specifically to show users on the platform, and also each users will have a single page (works like custom post stype), where it will show that user’s data, images, etc?

Currently in the themer, I don’t see any option to conditionally show for user archive and user single.
Any advices? Thanks!

Hi @lukelee,

This is a bigger topic than can be covered in a single post and requires a lot of careful planning and development.

Some points:

  1. You will most likely need to create a custom post type and custom post archive for this

  2. You will most likely need to add custom fields to the User and display those and the default fields in your custom single template

  3. You may want to use a User Query:

  4. Cwicly does support author archive pages which may or may not be useful for your purposes:

Hi @StrangeTech ,

For some reason, I don’t see the Author archive or Author single from the template visibility condition?

There is only Author Archive, there is no such concept as Author Single because the WordPress Author Archive’s purpose is to show all posts related to an Author - so technically speaking it can be considered a Single Author Page showing an Archive of Posts.

Ok, so I am working on a similar situation and basically had the exact same question as @lukelee. @StrangeTech, are you saying that it’s not really possible to have a single page listing for users, or are you saying that it’s just done differently? I have been using a CPT called ‘profile’ that each of the users was the author of… but this morning, I got the clever idea that perhaps it would be super easy to simply add those custom fields to the actual user profile. But now, I am struggling even to get a query loop to show the user items, let alone how to create the single user profile page. Should I go back to my original plan using a CPT for the user profiles, or would someone be able to provide me some assistance on how to create a query loop on a regular page for the user profile items (both WP and custom from ACF) and how to create a single profile page with the user information on it?

Just done differently. The author archive as previously mentioned is simply an archive of the current user’s posts by default.

If you create a template for it, you can add whatever you want to it, including fields from the user’s profile.

It really just depends what data you want to include in the template.

Ok cool thanks! What about the loop item for users to search and redirect to it? Do you have a suggestion on how i could achieve that? Right now i have a cpt called profiles, and i have been able to create a page with a query loop that then directs users to their profile page. Ideally, i would like to achieve the same result but for the base data use the user profile, and custom meta on the user profile and direct them to a customized user page that uses the visability to show or hide features for the public, other user s and the user. I was trying to create a loop item with the user info but didnt get very far. Here is my current set up partially complete so you can get an idea. If you choose the second one Gary Inman, you can see where i am going with the single user profile page. It will be a public listing, for guest to search for and find a designer, but also a social page for the user to interact with the other memebrs and only visible to certain user roles, and finally a place to hold their account information, create posts etc… only visible to the user. Thanks so mu for taking the time to answer! @StrangeTech
https://icidworld.com/search-designers/

When you say “custom meta”, are you adding via ACF fields or meta added via some other plugin or code?

Cwicly does have a User query, that you can use to display a list/grid of users.

Screenshot 2024-02-13 at 20.08.16

It allows you to show the following fields built-in:

Screenshot 2024-02-13 at 20.00.36

You should be able to access data in ACF fields added to any user in the same way as for a Post query.

If you want to access more meta information about a user that is not in an ACF field, you will need to use custom code at the moment, because there is no User Custom Field option yet (like there is for the logged in user or post author - see below).

I have raised a feature request to add this here:

Additional notes:
Effectively for the logged in user, Cwicly has the following information available:

Screenshot 2024-02-13 at 19.39.51

You can also access custom fields for the logged in user via the User Custom Field option:

Screenshot 2024-02-13 at 20.07.42

For a given post, Cwicly provides access to the same information for the Author of the post using the “Author Info” and “Author Custom Field” options.

1 Like

@ShannaKae So it is possible actually, as I ended up building the user profile pages and directory by using WordPress’ default author post type.

Then, I added custom fields for user as user meta, and then you will have to code something in your function.php to display the ‘queried user’ 's meta, as currently Cwicly does not support them in the dynamic data selection.

My approach is to code shortcodes in my functions and use those shortcode in my ‘author single’ template, the approach is to get the current queried user’s id by the slug.

For query, you will use ‘Users’ as your query source, and to get the user meta, you make sure to select ‘query user’ as your dynamic source.

Hope this helps.

1 Like

As a quick follow up, you can add ACF fields to the Users with the following strategy:

And this is what it looks like in the WP Admin User profile edit page:

Screenshot 2024-02-13 at 21.36.40

1 Like

Thank you so much for your response, I am hoping to find a no code solution, but if it comes to it, it is good to know there is a solution. I am not a coder in the traditional sense but i can generate it and add it as needed but since i dont write it or really read it, i try to limit it as much as possible. But I can do it if needed. Thanks so much. Did you see @StrangeTech responses? I am going to review those in more detail. But it appears there may be a no code solution for me… not sure thought I will have to dive a bit deeper. Thanks again for taking the time to respond to me.

Cool, thank you so much! Ya I meant ACF Fields, not custom meta. This is very helpful! Let me give it a spin. Thanks again for taking the time to answer me it is VERY much appreciated.

1 Like

THank you, now that i am deeper into the project I think I am seeing the issue you ran into. So I have the Author Archive page (user profile page), set up and actually so far the standard and custom fields are working as expected without any additional code. However I am struggling with getting a repeater field to work. Do you have a suggestion? Any specific direction would be good. Idon’t write code but if i am pointed in the right direction i can have AI help me. Thanks so much! @StrangeTech

What specifically is not working?

If you share more details about what you are seeing, the issue will probably reveal itself.

Hey I heard back from Cwicly and it is a bug or not supported currently. Since I am not a dev and dont write code, i have opted to go back to using my profile CPT as it is inherently connected to my users via the fact that they are the authors… I think for my purposes this approach is going to be easier as the integration between users/authors is achievable between between them and cpts… it is more complex than simply connecting cpt to cpt… I may revisit later on but may be good with this set up after all. I was headed down another rabbit hole that i dindnt ned to go down and after working on this site for over a year I cant afford any more rabbit holes, LOL.