Skip Navigation

[Resolved] Archive page of a custom post type

This support ticket is created 6 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.

Our next available supporter will start replying to tickets in about 7.16 hours from now. Thank you for your understanding.

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)

This topic contains 5 replies, has 3 voices.

Last updated by Shane 6 years, 5 months ago.

Assisted by: Shane.

Author
Posts
#595973

Hello,

I have to create a lot of custom post types and i want each of them have archive page created by be as page.
Right now i have pages setup, lets say i have a page called Bars and this page load all bars from Bars custom post type.
I want the archive page of the custom post type BARS be the page BARS.
Is there any way to make this work and get the correct url like site.com/bars/barname?

Thanks

#596077

Hi, the best way to accomplish this in Toolset is to delete any custom page that exists at the /bars URL, then go to Settings > Permalinks and resave your permalinks. Go to Toolset > WordPress Archives and create an archive for the Bars post type. The URL structure /bars/bar-1-slug will be used to display each bar (assuming the CPT slug is "bars", you can manage this in the Post Type editor). The URL /bars will contain your WordPress Archive of bars. You can style that archive however you want, and it can include any content you previously included in your custom "Bars" page, along with the Loop of results.

More information about WordPress Archives here:
https://toolset.com/documentation/user-guides/normal-vs-archive-views/

Please let me know if I have misunderstood what you want to accomplish.

#597117

Hello,
maybe my question was not so clear.

Lets say, i have a PAGE called "BARS" this pages was build with visual composer and have The Grid plugin output of the custom post type called "BARS"
In this page i get all the BARS from the custom post type and words perfectly.

Now i want this page "BARS" be the archive of the custom post type bars or something like parent page of the bars custom post type.

When i add child to BARS page the url is domain.com/bars/barname when i add to custom post bars i want the domain be the same but the /bars/ be my page.

domain.com/bars/ have to be my page and all the items under the custom post type bars have to be "child" to bars and include the bars on the url.

#597465

Now i want this page "BARS" be the archive of the custom post type bars or something like parent page of the bars custom post type.
Yes, I understand what you want to accomplish. In order to do this, you should delete the custom Page "Bars" and any child Pages of "Bars". You should not have any Pages for domain.com/bars or domain.com/bars/barname. Make a custom post type with the slug "bars". Then WordPress will automatically make the URL domain.com/bars/ an archive of your Bars post type - no Page is required for this URL. If you want to change the style of the archive shown at domain.com/bars, you can use Toolset WordPress Archives to provide your own styles. If you want to use Visual Composer to design this WordPress Archive, you can use a Content Template. Edit the Content Template using Visual Composer. Then insert the Content Template in the Loop of the WordPress Archive.

When i add child to BARS page the url is domain.com/bars/barname when i add to custom post bars i want the domain be the same but the /bars/ be my page.
domain.com/bars/ have to be my page and all the items under the custom post type bars have to be "child" to bars and include the bars on the url.
To add a Bar post, do not add a child "Page". Add a new post in the Custom Post Type "Bars". It will automatically be included in the domain.com/bars/ archive, and the URL will be domain.com/bars/post-title-slug. This is how WordPress works by default, so no custom Pages are required. These posts will not be children of "Bars", they will be posts in your custom post, type "Bars".

#598082

Hello again,

ok now its more clear, i was almost the same way but still the archive page using wordpress Archive cant get my html design.
The reasson is that i dont want the loop to be part of this page because im using different way to get the results. so i have to remove all this
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

and add my shortcodes for example visual composer shortcodes or my custom shortcodes without set loop, something like what i do with content templates

#598539

Shane
Supporter

Languages: English (English )

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

Hello,

As Christian is currently on vacation I will be assisting you with this.

You do have the option to use your visual composer code in our Custom Archive with Views, however you will need to have the loop information in order for it to loop through all the posts and display them on the archive page itself.

Thanks,
Shane

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