Skip Navigation

[Resolved] Working with Avada and setup for custom posttype as author.

This support ticket is created 7 years, 5 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

This topic contains 12 replies, has 2 voices.

Last updated by gerhardR-2 7 years, 4 months ago.

Assisted by: Luis Sacristán.

Author
Posts
#517788

Hello, i am refering here to a previous topic:

2. I setup a relationship between a custom post type as the parent of posts to make the custom post type the author of the post.

I have to interrupt here. There is something I do not understand.
"to make the custom post type the author of the post".

Custom Post Types are no authors. Authors are Users.
Something is confused here.

Please, can you elaborate what you mean with Author? Authors are users, and users cannot be in a relation of parent/child to posts.

2. Sorry for not explaining this properly. you can have a look at the site.

hidden link

so i have a custom post type Couchsurfers and these Couchsurfers should be authors of posts. but they also need views and content templates and such. Long time ago i tried to do it with users and i would prefer to do it like that, but i figuered that it would not be possible, right?

I would prefer to do it with the wordpress Core users, because that would allow me to leave the blog archive like it is.

i figured if i continue like that i will build a custom post archive for the Blog to be able to have the Couchsurfers as authors in the posts. is that the way to go?

the post relationships work fine now. i know how it is supposed to work, but the first relationship i set up showed up on two childposts, which was not supposed to be.

what i did now to make it look like Avada is something like that:

<article class="fusion-post-medium post fusion-clearfix type-post status-publish format-standard has-post-thumbnail">
<div class="adjust-thumbnail fusion-flexslider flexslider fusion-post-slideshow">
<ul class="slides">
<li class="flex-active-slide" style="width: 100%; float: left; margin-right: -100%; position: relative; opacity: 1; display: block; transition: opacity 0.6s ease; z-index: 2;">
<div class="fusion-image-wrapper fusion-image-size-fixed" aria-haspopup="true">

[wpv-post-featured-image size="medium" class="attachment-blog-medium size-blog-medium wp-post-image"]

</div>

</div>

<div class="fusion-post-content post-content">
<h2 class="entry-title fusion-post-title">[wpv-post-link]</h2>
</div>
<div class="fusion-post-content-container">[wpv-post-excerpt length="30" count="word" more=" - ..."]</div>
<div class="fusion-clearfix"></div>
<div class="fusion-meta-info">
<div class="fusion-alignleft">
<span class="updated rich-snippet-hidden">[wpv-post-date format="F j, Y g:i a" type="modified"]</span>
<span>[wpv-post-date]</span>
<span class="fusion-inline-sep">|</span>
[wpv-post-taxonomy type='category']
<span class="fusion-inline-sep">|</span>
<span class="fusion-comments">
hidden link">[wpv-post-comments-number]</span>
</div>
<div class="fusion-alignright">

Read More

</div>
</div>
</article>

more or less, i know the link for the comments is not right yet.

does it make sense to do it like that? i just copied the whole avada containers and classes and filled it with types shortcodes and it makes it look exactly like it. if thats a way to go i would build up the post archives and the posts in a similar way.

#517794

Luis Sacristán
Supporter

Languages: English (English ) Spanish (Español )

Hi

I am taking your previous ticket too. I will help you with both tickets 🙂

Regards
Luis

#517814

Luis Sacristán
Supporter

Languages: English (English ) Spanish (Español )

Hi

Where did you read "to make the custom post type the author of the post"?

Like you said, Authors are users and CPTs can't be able to be the authors of a post.

I will continue replying the rest of your ticket in a while

Regards
Luis

#517817

I have a custom post type which is "Couchsurfers" which are actually people. I have them on a map and in a view like on this page:

hidden link

and they have kind of pofile that i made in a layout. at the end of this page you can see the posts i related to him:

hidden link

and now i think i have to create an archive that shows the parent posts instead of the author and a parent post custom template at the end of the post for an author. that would work right?

Would there be a way to achieve all that with users?

#517853

Luis Sacristán
Supporter

Languages: English (English ) Spanish (Español )

Hi

Now I understand what you need ?

I think you were confused about Authors, because I think you was reading an example about Books and Authors (Book's auhors). In this case Authors are not users, are kind of Wikipedia posts ?

In your case you should use WP Users. This is what I'd do:

#517883

Thank you so much. I think i get it now and this solution is of course a lot better.

does it mean, that i can handle users exactly the same way as post types? so i would not even have to create a custom post type for stays right? i can just create date and nights fields for the user?

and do you think my approach to getting the avada design into the user profiles makes sense?

#517890

Luis Sacristán
Supporter

Languages: English (English ) Spanish (Español )

Hi

Yes, you can use users as CPT-ish, add fields as address, pinteres, job title, ...

I will not recommend you to add the stays into the users profiles because although you can set a field as "Allow multiple-instances of this field", the stays are really a group of fields (# of days, arrival, departure).

Let me explain better:
- Using user fields you will have:
* Name
* Pinterest
* Num. of days - 1
* Num. of days - 2
* ...
* Num. of days N
* Arrival - 1
* Arrival - 2
* ...
* Arrival - N
* Departure - 1
* Departure - 2
* ...
* Departure - N
* Address
- Using CPT
* Name
* Pinterest
* Stay 1 (Num. of days, Arrival, Departure)
* Stay 2 (Num. of days, Arrival, Departure)
* ...
* Stay N (Num. of days, Arrival, Departure)

Regards
Luis

#517899

Luis Sacristán
Supporter

Languages: English (English ) Spanish (Español )

I forgot to tell you that it is fine to use Avada design for your users pages

#518016

Thank you so much for clearing this. I understand it much better now.

But as far as i see i can not create content templates and views for users, right? how would i go to create these profiles with a map and all that? and could i use layouts for it?

otherwise my original approach would be fine, if i dont need them to sign up on their own and to publish the blog posts on their own right?

It would be much nicer to work with them as users, but if Layouts and content templates are not for users i do not understand yet how to display them the same way as post types.

and about the use of user fields combined with a custom post types for the nights. At the moment it is also just one group for all of the fields. If i do not add many more fields it is actually not that bad right to have a longer list of them, right? or would it be to exclude them from a profile in case i enable them to edit it?

#518206

Luis Sacristán
Supporter

Languages: English (English ) Spanish (Español )

Hi

1) You can create a view to get all users (crouchsurfers). This view can be included in a Layout, but this Layout can't be assigned to a Users archive (this archive doesn't exist in WP). You can use this Layout in a page where you will show the users archive, it is a users archive simulation.

2) I thought you wanted crouchsurfers handle their own content, my bad. If they are not going to publish content you don't need to add login/sign up/publish features to your site.

3) As I told you in point 1. You need to create a page where you will display a View that shows users. It will simulate users archive. This view can be included in a Layout inside this page.

4) That depends of what you have in mind with your site. In my experience, it cost more to change something when the site is live, with real data, that develop more features in the first stage of the project.

Regards
Luis

#518685

Dear Luis,

thank you so much for this detailed information.

So i worked on it for a while and as you said it would cost more to change something later on. The approach to use users instead of post types seems to make much more sense, because i could let them create and edit their own posts if i want. And i can setup newsletters and such for these users as well.

I already tried to setup the exact same thing as with the "Couchsurfers" Post type. I used a layout and made it the author archive. Is this what you mean by user archive simulation? I have them listed in a view and from there i can go to their archive page.

hidden link

works fine so far, but it seems that the user fields in the archive is only displayed when the user already created a post. Only very few users are going to write posts. Is there a way to show the information anyway? And how can i get rid of the biography and "About" text on top? Only by editing the author.php in the template? because this cant be done through a child theme and has to be overwritten again every time right?

Anyway now i am thinking, would it make sense to let them sign up as normal users first and then manually asign a "Couchsurfers" post type to make it their profile? Am i right, that i could create this custom type profile post manually and then only give them the right to edit it. That way there will always only be the one post that i assigned per user.

Sorry for all these questions, i am just not sure yet how it works and in which direction to go with this. what would be the best solution?

best regards
Gerhard

#519716

Luis Sacristán
Supporter

Languages: English (English ) Spanish (Español )

Hi Gerhard

Sorry for the delay, national days off in Spain 🙂

The page /people2 returns a 404 error, have you deleted it?

The users' fields should be shown regardless of if they have publish a post. Would you mind to share the view you used?

I think It is a good idea what you suggest. Let them sign up and edit their content. You can also let them create their own content but configure this CRED status as "Pending", so you will only need to review their content and not create it. The less you work the better. Now you will have a few users, but you can dye of success.

Regards
Luis

#520692

Hello Luis,

thank you very much for your answer. I changed my approach again and it works perfectly now. I use users so they can sign up normally, then i upgrade them to Couchsurfers with Contributors rights and manually assign a custom post type Couchsurfer to them.

in their "my account" page i created one link to edit the user information. and another one with a view named "edit surfer information". they only have the right to edit their own posts and the view only returns a link to the edit link for their posts. of course it just returns one edit link, because i only assign one CPT.

i deleted the people2 page after i found this approach, because i was able to continue the way i started. no need to setup the archives or other user profile page as the layout for the CPT was already finished.

hidden link

and you are right. i already found out how to let them post, but keep the posts pending. that's so cool!

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