Skip Navigation

[Resolved] Display a standard page in place of the main post type archive page.

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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 7 replies, has 2 voices.

Last updated by carlosA-12 1 year ago.

Assisted by: Waqar.

Author
Posts
#2599283

For my custom post type I want to use a standard wordpress page in the place of the archive page. On my standard page I will manually link to the various post categories. Using a standard page allows me to have an editor so I can use blocks to build some intro content before linking to the post categories. When on a category or single post page the rank math breadcrumbs will show the correct hierarchy /Portfolio/Category/Postname. If someone clicks on the portfolio link, instead of loading the main archive for the post type, it will load a regular page. How can I do this with toolset?

hidden link

#2599349

I have been unable to create create static content at the top of my archive page other than pasting some code in the loop. Using the block editor would be ideal. I will also need the ability to add a custom template for the categories of this archive. On the root archive I did not want to use the standard archive format that kadence applies to archives so I turned off title in the customizer, but I do want to show a title for the category archive so somehow I need the ability to create a separate template for the category archives vs the root archive of the post type. I had considered using the single archive template and trying to use conditional logic to show the static content for the root archive and hide it on categories, but I was unable to find conditional options that worked, I would have to conditionally hide the post loop on the root archive page but display it on category pages.

Ideally the root archive page of my custom post type would show my static content and then loop through each category, displaying a featured image of that category, its name, and the amount of posts in the category.

I'm in a time crunch to get this done, so looking for the best solution.
hidden link

Thanks.

#2599481

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

To suggest the best way to achieve this, I'll need to see how is these post-type archives and the category archive pages are set up in the admin area.

Can you please share the temporary admin login details, in reply to this message?

Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.

regards,
Waqar

#2599789

Here is the post type I build on my old site.
I'm aiming to do something like this with toolset.
hidden link

#2600171

I want to mention that from my first video I pointed out there was an issue with toolset because the tutorial for creating an archive template showed a very different experience than what I was presented. There was not a drag and drop builder with buttons on top - Add sorting, Pagination, Other blocks, etc. This experience does not load for me.

I know you cant go doing a full archive template for me but I would like to know how to fix my experience and know if toolset will work for my needs. I cannot determine this myself as its not working as the tutorials describe.

#2600199

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for sharing the access details.

Your recent messages, cover a range of topics, so I'm going to explain them section by section:

1. Editing experience:

When creating or editing a WordPress Archive or View in Toolset there is a choice of using two types of editors:

a). Classic/legacy editor:
This editor uses the classic HTML and shortcodes elements to generate the output, as can be seen in your existing WordPress Archive 'Portfolios Archive'.

b). Blocks-based editor:
When WordPress introduced the default editor 'Gutenberg' that uses different blocks, we also introduced the blocks-based editor for the WordPress Archives and Views.

That is the same editor that you see in our updated tutorials and documentation.

You'll find the setting to control which type of editor should be used to create a new WordPress Archive and/or View, at WP Admin -> Toolset -> Settings -> General -> Editing experience.

Currently, the option 'Show only the Blocks interface' is selected on the website, so if you'll create a new WordPress Archive, it will be created using the blocks-based editor.
( I'm not sure how the existing WordPress Archive 'Portfolios Archive' was created using the classic/legacy editor. Maybe the editing experience option was set to a different option earlier? )

2. Showing different content on the post type archive page and the category archive page:

There are two ways you can achieve this:

a). Two separate WordPress Archives for each type of archive

At the moment a single WordPress Archive 'Portfolios Archive', is selected to be used for the 'Portfolios' post type archive, as well as for the 'Portfolio Categories' taxonomy's archive.
( screenshot: hidden link )

You can create one WordPress Archive for the 'Portfolios' post type archive and the other one for the 'Portfolio Categories' taxonomy archive. This will allow you to control the display of the content for each type of archive, independently.

b). Using conditional logic to display different content based on the current type of archive

If you'd prefer to use a single WordPress Archive for both types of archives, you can use the WordPress function 'is_post_type_archive' to conditionally evaluate whether the 'Portfolios' post-type archive page is being viewed or not:
https://developer.wordpress.org/reference/functions/is_post_type_archive/

You'll add the 'is_post_type_archive' function name in the 'Functions inside conditional evaluations' field at WP Admin -> Toolset -> Settings -> Front-end Content so that it can be used in the conditional evaluations.

After that, you can use this function in the conditional statements in the classic/legacy WordPress Archive, like this:
( ref: https://toolset.com/documentation/legacy-features/views-plugin/conditional-html-output-in-views/ )


[wpv-conditional if="(is_post_type_archive('portfolio') eq 1)"]
<h2>This is portfolio post type archive page</h2>
[/wpv-conditional]

[wpv-conditional if="(is_post_type_archive('portfolio') eq 1)" evaluate="false"]
<h2>This is not a portfolio post archive page, so it must be the Portfolio Categories archive page</h2>
[/wpv-conditional]

Note: If you're using a blocks-based editor, you'll see the 'is_post_type_archive' function name in the custom functions list in the 'Conditional' block's options.

3. Creating a list of 'Portfolio Categories' taxonomy terms, dynamically:

Toolset supports creating a customized list of taxonomy terms, but using the classic/legacy view's editor only. With such a view, you won't have to manually add/manage the Portfolio Category names and feature images, on the post-type archive page.

If you're interested in creating such a view, let me know and I'll explain the steps in the next reply.

I hope this explanation helps and please let me know if you have any follow-up questions.

#2600203

I dont feel like this was a fair response to my support request. Ive tried multiple times to get the block editor experience your tutorial displays. I was hoping you would test this and see my experience. Id like a refund if we cant get this working. Please just login and try to create an archive template and see that the experience of the editor is not working.

#2600303
2023-04-27_14-05-08.png

Im not sure if you changed anything, but this is the first time I've seen this block builder format displayed while creating an archive template. I had set it to block only and tried multiple times previously and never got this block builder to have any resemblance to your tutorial. This is now working correctly. Sorry if there wasn't something for you to do, I have no idea what its not working.

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