Skip Navigation

[Resolved] show taxonomy archive for restricted content

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that the user wanted to build a membership type site with some content being restricted to lower level users.

Solution:

I would recommend taking a look at the link below.
https://toolset.com/learn/create-membership-site-wordpress-using-toolset-plugins/

This support ticket is created 5 years, 6 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 15 replies, has 2 voices.

Last updated by winyS 5 years, 6 months ago.

Assisted by: Shane.

Author
Posts
#1285153
Schermafbeelding 2019-07-05 om 16.21.42.png
Schermafbeelding 2019-07-05 om 16.22.01.png

I am trying to make a membership website for training courses.
I started with your example membership site "Knowledge center" on discover-wp.com and did some tweaks.
I have several training modules. Each training module is a custom taxonomy (term of "Module Category") of the cpt "Modules".
I currently have 2 terms, Wildlife and Waste.
The Modules are for members only.
The archives I want to display also for not members.
The archive /module, that lists all modules of both Wildlife and Waste, displays, for not logged in users.
But the Term archives, /module-category/waste and /module-category/wildlife display only: "No items found" when you are not logged in.

#1285273

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Winy,

Thank you for getting in touch.

So you want your restricted items to be visible to non-members on your post type archive is that correct?

Is there a link that you can send me to so that I can have a look at this ?

Thanks,
Shane

#1285467

Hi Sgane,

So you want your restricted items to be visible to non-members on your post type archive is that correct?
Yes, but also on the post type taxonomy archives:
hidden link and hidden link.

Is there a link that you can send me to so that I can have a look at this ?
I created a copy of the website here: hidden link
I can give you admin access if necessary.

Thank you,
Winy

#1286489

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Winy,

I dont think this one will work the way you want it to because if you have restricted the posts from guest access then they won't show up.

You are using our access plugin correct?

Would you mind allowing me to have access to the website ? Also i've noticed that screenshot you sent initially is different from the page you've sent.

Could you send the exact page in the screenshots ?

THanks,
Shane

#1286839

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Winy,

Thank you for the credentials.

I tried to log in and it says the credentials are not active.

Could you check on them and let me know.
Thanks,
Shane

#1286857

Sorry! I have activated the user. You can login now.

#1286915

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Winy,

As suspected no this won't be possible.

This is because you've restricted it in access to the users so it won't show up.

There isn't a workaround for this to restrict the posts and still show them on the archive page.

Thanks,
Shane

#1287467
Schermafbeelding 2019-07-09 om 11.26.49.png
Schermafbeelding 2019-07-09 om 11.27.14.png
Schermafbeelding 2019-07-09 om 11.27.39.png
Schermafbeelding 2019-07-09 om 11.26.02.png
Schermafbeelding 2019-07-09 om 11.25.29.png

Hi Shane,

I think it must be possible.

I started with this example site: hidden link
When I click on Advanced Tuts I see the archive, even if I am not logged in: hidden link
When I click on an advanced tutorial on this archive page I see that I have to log in to view the full tutorial: hidden link
This is exactly what I want.

The only difference with my website is that I did not create a custom post type for each tutorial (Module) category. Instead I use the category archives (Module-category) to show a list of the tutorials in that category.
When I am not logged in and I click on All modules I see the archive of all modules, belonging to all Module categories.

Now I want to split the modules in categories to give a user the possibility to view all modules of just one category. I added In the header menu I added links to the module category archives: Waste and Wildlife (there are 2 now, in the future there will be more).
hidden link and
hidden link
When I am not logged in I can not see see these category archives. I see the category description text and "No items found".
Here I want to show up the module image and title with link, like in other archives.

Is this possible and how?
I hope you can help me to find a solution.

Thank you,
Winy

#1287861

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Winy,

So this actually works for the Module CPT.
hidden link

The problem is that you were accessing a taxonomy page which doesn't function the same way as the CPT works.

Its the same in our Demo and the demo is using a Custom Post Type. So in your case the custom post type works fine.

Thanks,
Shane

#1287943

Hi Shane,

Thank you for taking a look again.
I currently have Modules (lessons) and Module Categories (Topics)
Will it be a solution if I create a new CPT for each Module Category (Topic), currently Wildlife and Waste, (and for all future topics), instead of Module Categories?

#1288049

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Winy,

It would introduce some management issues with this but yes you can.

Or You can keep the Modules CPT and create the module categories as custom fields, like a checkbox.

Are you just using these categories to sort them ?

Thanks,
Shane

#1288059

It would introduce some management issues with this but yes you can.
I assume that you mean that there will be a lot of post types in the Dashboard if I add more Topics?

Or You can keep the Modules CPT and create the module categories as custom fields, like a checkbox.
I can try that. Will it be possible then to view an "archive" that shows only the modules (lessons) of a specific category?

Are you just using these categories to sort them ?
Yes, I use categories to sort them. I want to give a user the option to view all Modules (lessons) of just one topic, instead of all Modules (lessons) of all topics.

#1288089

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Winy,

Will it be possible then to view an "archive" that shows only the modules (lessons) of a specific category?

A. You won't be able to create an Archive for this through the traditional way but you can create a view that will list them out based on the selected custom field value.

Thanks,
Shane

#1290355

Hi Shane,

I tried your suggestion: keep the Modules CPT and create the module categories as custom fields, like a checkbox. This was not the ideal solution for my.

But I found the solution.
I created a view "list-modules-wildlife-3" that lists all modules and added a Taxonomy filter:
Filter by the taxonomy "Module Categories"
Module Categories are: set by the current archive page.

I edited the Archive for the taxonomy "Module Categories":
I deleted everything between <wpv-loop> and </wpv-loop>.
I deleted everything between [wpv-no-items-found] and [/wpv-no-items-found]

I inserted the view before [wpv-layout-start].

He code of the archive is now:
[wpv-view name="list-modules-wildlife-3"]
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
</wpv-loop>
<!-- wpv-loop-end -->
</div>
[/wpv-items-found]
[wpv-no-items-found]
[/wpv-no-items-found]
[wpv-layout-end]

And this works.
Not logged-in users will see the Featured image and post title with a link and when they click on the link they get the message that the content is restricted to members only.

So I think this is a workaround.
What do you think?

Thanks, Winy

#1290607

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Winy,

Yes this is actually a good workaround. Since the users are not able to see the archive directly then this is a good workaround.

Also keeping this area blank

<!-- wpv-loop-start -->
<wpv-loop>
</wpv-loop>
<!-- wpv-loop-end -->

Will prevent anything from being displayed by the archive when a user is logged in.

Thanks,
Shane