Hello
i need to display a directory list of members. i've readen that it's not possible to create archive
with USER fields, only using CPT. So i created a "PAGES MEMBRES" CPT with a slug named "membres".
I created an archive but i can only see it following this link :
hidden link
I'd like to display this archive on a specific page, only to the logged customers with specific access to this url :
hidden link
How can i do that ?
Thanks for your help.
Chris
Dear Chris,
Please elaborate the question with more details:
I'd like to display this archive on a specific page, only to the logged customers with specific access to this url
How do you setup "this archive" and "specific page"?
How do you setup the "specific access" of logged customers?
I need to test it, and check if it is possible, thanks
Hello Luo,
When i create an WP archive, it uses the Custom Slug to display the archive.
For instance,
I create a Member CPT with a slug named "membres", it will display the archive on a specific page named
hidden link (url-of-my-website= : hidden link )
I'd like to display this archive on a specific slug, only available on logged page (the user needs to login to access these pages)
All the private content are child of a page named "espace client" (slug : espace-client).
so every page under /espace-client/ are only available to the logged users.
Now i'd like to display my Archive for "membres" CPT ONLY on a specific page with a specific name and slug "trombinoscope", private content.
(real url : hidden link )
How can i do that ?
Thanks for your answer.
I assume we are talking about this case:
1) a WordPress page:
hidden link
2) a custom post type "membres", you are going to display the archive page of post type "membres" as below URL:
hidden link
It is possible, for example, you can edit the post type "membres", in section "Options":
- enable options "Rewrite", enable option "Use a custom URL format", and use below URL format:
espace-client/trombinocope
So the archive page of post type "membres" will be as below URL:
hidden link
And single "membres" post URL will like this:
hidden link
hidden link
...
But it is not recommended to setup like this, it will conduct some unexpected result, as you mentioned above, WordPress will take the archive page as a child page of "espace-client"
More help:
https://codex.wordpress.org/Function_Reference/register_post_type#rewrite
Triggers the handling of rewrites for this post type
For the question:
the user needs to login to access these pages
You can try the Toolset Access plugin:
Dashboard-> Toolset-> Access control-> Post Types
- enable option "Managed by Access" for post type "membres"
- disable "Read" capability for gust user.
So only logged-in user can see the archive page and single post of post type "membres".