Skip Navigation

[Resolved] Archive is not showing any content for custom post type

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

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 3 replies, has 2 voices.

Last updated by Christian Cox 6 years, 9 months ago.

Assisted by: Christian Cox.

Author
Posts
#553107
attorneyarchivepage.png
screenshot-rk.innerspacedev.com 2017-07-26 12-33-44.png

I am trying to: create an archive with a filterable search for attorney name and practice area (dropdown list). I have 31 attorneys under the custom post type set up.

Link to my site: hidden link

I expected to see: search area and bootstrap grid of 1 column with attorney name, practice areas, and email address on one line per attourney.

Instead, I got: No results. hidden link

#553200

Hi, I'll try to get this sorted out for you. First, let's look at your WordPress Archive here:
/wp-admin/admin.php?page=view-archives-editor&view_id=2163

This is the archive that will display the list of Attorneys on the /attorney page. I see in the Template area "Loop item in Attorneys" it appears that there is an issue with special characters being placed instead of double quote marks. Please review the shortcodes there and replace the special characters with actual double quotes so the syntax looks like this:

[types field="attorney-name"][/types]

Save the archive and check these fields again. If the special characters have returned, we may have to investigate further.

Next, take a look at the Layout for Attorney Archives here:
/wp-admin/admin.php?page=dd_layouts_edit&layout_id=2153&action=edit
It appears that there is a View in this Layout, instead of the proper WordPress Archive. This is the main reason you're not seeing anything on the /attorney archive page - your Archive is not associated with your Layout. Please replace the View cell with a WordPress Archive cell. When you add a WP Archive cell, you will be able to select your Attorneys WP Archive to display there.

Let me know if you have questions about these steps and I'll try to give you some more guidance.

#553212
screenshot-rk.innerspacedev.com 2017-07-26 15-42-18.png

Well, I did what you advised, and it is still replacing the single quotes with code - even after I corrected it. I edited and I was able to get it on the page.

The problem is now it looks like a hot mess and I need a bit more guidance sorting out the issues.

hidden link

1) I'm using Divi theme. Is there a way to override the standard right sidebar template with your template for this archive page? It's showing up underneath the search area on the left side.

2) Where is the best place to define the drop down box for Practice areas? You can see it is showing partial code. Perhaps I need to make this box a category drop down? I have that as a taxonomy.

3) I'd also like to get all of the people listed on one page without pagination.

4) Here's what I'm trying to create on this archive page with toolset - a search area, a list of names in a structured table format, that shows all results on the page load, and the table dynamically changes based on search criteria - and the names are linked to that person's profile post.

This is my guideline sample: hidden link

Do you know of a toolset tutorial that can point me in the right direction? I know that's a lot to ask.

#553244
pagination.png
value.png

Well, I did what you advised, and it is still replacing the single quotes with code - even after I corrected it. I edited and I was able to get it on the page.
This concerns me because it may indicate a conflict with your theme, or another plugin. If you're able to get it working, that's fine, but if you continue to experience problems with this I recommend opening a separate ticket so we can investigate further.

1. I'm using Divi theme. Is there a way to override the standard right sidebar template...
Not with Toolset, unfortunately. The only way I know to modify the Divi wrapper is to create your own custom archive template file using PHP, and modify the code use a full-width design on this archive page. The Divi support forums would be the best resource for this type of information, but a quick search led me to these articles:
hidden link
hidden link

2. Where is the best place to define the drop down box for Practice areas? You can see it is showing partial code.
It looks like you want to filter based on the Practice Area custom field, is that correct? The simple solution is to use a different type of custom field instead of a multiple line field. See the attached screenshot value.png - this custom field won't work as a dropdown filterable field for multiple reasons:
- The value includes HTML
- It includes multiple options that you want to be able to filter separately.

Instead, use a select field, or a multiple select field, or checkboxes, or radio controls. This way you can define the options and values one by one. Do not include HTML in the value of each option. Only use simple text strings with no spaces. Then the filter options will be constructed automatically for you when you insert the filter controls in the WP Archive editor.

3. I'd also like to get all of the people listed on one page without pagination.
No problem, see the attached screenshot pagination.png. There are pagination settings in your WordPress Archive editor you can choose from. If you are unable to see the pagination settings in your editor, you may need to enable it by clicking "Screen Options" in the top right corner of the page.

4. Here's what I'm trying to create on this archive page with toolset
The alphabetical name filter will require a bit of custom code. There's not a way to filter by "first letter" of a post title or custom field. To make this work, you could create a separate custom field, and populate that field with the first letter using a save_post hook. Then you can filter based on that custom field and include options for each letter. This is a bit too complex to describe here, so I recommend opening a separate ticket asking for help creating an alphabetical filter in your WordPress Archive.

...the table dynamically changes based on search criteria
There's a section in the WordPress Archive editor called "Custom Search Settings". If you cannot see it, use the Screen Option tab in the top right corner of the site to enable it. Once it appears, you can select "AJAX results update when visitors change any filter values" to have your archive results change automatically based on the search filter selections.

Do you know of a toolset tutorial that can point me in the right direction?
Here's a guide:
https://toolset.com/documentation/user-guides/normal-vs-archive-views/
I also recommend the training course here to get a general idea of how Toolset plugins work:
https://toolset.com/documentation/toolset-training-course/

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