Skip Navigation

[Resolved] Unable to display custom post type in a View

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

Problem: I have created a View of a custom post type using a post relationship filter, but the custom fields are not appearing.

Solution: In this case, it looks like the View's Loop Template became corrupted somehow. Recreating the Loop Template solved the problem, though I'm not sure how it became corrupted.

This support ticket is created 6 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
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 8 replies, has 2 voices.

Last updated by teganK 6 years, 6 months ago.

Assisted by: Christian Cox.

Author
Posts
#947821

Dear support,

i need help

as i have created a post type "Sales consultant" I am unable to fetch them on front end using view.

#947824

Hello, please take a screenshot of the View editor in wp-admin so I can see how it is set up.

#947974

hidden link
hidden link
hidden link
hidden link
here are the screen shots

i am trying to make a view on
hidden link

i would appreciate your help
in making this work
thanks in advance.

#948389

Hi, it looks like there was a problem with the template for this View's Loop. I recreated it and now it seems to be working as expected. I placed the View in the Layout for House and Land Packages: hidden link

I also unchecked the checkbox "Don't include current page in query result" in the View editor. This checkbox should only be used if the View and the current page are the same post type.

#948396

thank you very much for recreating
can you please guide what wrong i was doing so that i dont have to seek for help next time ?
Thanks in advance

#948502

I'm not exactly sure how the Loop Template became corrupted, and sometimes it's not possible for me to know. While investigating, I copied everything out of the Loop Template and pasted it directly in the Loop Output editor. This seemed to work as expected, so my next step was to recreate the Loop using the Loop Wizard. In the Wizard, I chose not to use a Template for the loop. This disconnected the old Template from the Loop. Then I used the Loop Wizard again, and this time I chose to use a Template for the Loop. This new Template did not have the same problem present in the previous template.

#948750

so nothing is changed and ever thing is same what i did?
can u please share screen shots to demonstrate.

#949196
step1.png
step2.png
step3.png

The old corrupted Content Template was deleted, and a new Content Template was created. See the screenshots here.
Step 1: I copied the content from the old corrupted Content Template into the Loop Editor, replacing the Content Template shortcode. I tested the View. Everything worked as expected, so I suspected the old Content Template was corrupted.
Step 2: To delete the old corrupted Content Template, I used the Loop Wizard. This time, I did not create a Content Template for the loop. I saved the View and tested again. Everything displayed as expected.
Step 3: See the old Content Template has been removed. I created a new Content Template by using the Loop Wizard again. This time I chose "Use a Content Template to group the fields in this loop." This created a new Content Template that is not corrupted.

#949265

thanks