Skip Navigation

[Resolved] How to create a search view inside the content template for custom post type?

This support ticket is created 4 years, 4 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
- 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)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by puneetS-3 4 years, 4 months ago.

Assisted by: Shane.

Author
Posts
#1401377
Screenshot (17).png

I have a custom post type for current affairs for which I created a content template where i want to add a search view to filter the results by post-date custom field.

After doing this, an error message is occurs:
"Content not displayed because it produces an infinite loop.
The wpv-post-body shortcode was called more than once with the attribute view_template="content-template-for-template-for-current-affairs-layout" over the post "26 November 2019", triggering an infinite loop."

This is the issue i already asked for
https://toolset.com/forums/topic/how-to-create-a-calendar-widget-for-custom-post-type/

As this still is not possible to do, so i m thinking to create a search view by cutsom field post type.

#1401639

Shane
Supporter

Languages: English (English )

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

Hi Puneet,

The custom view is listing out the same CPT as the one being displayed correct?
Secondly is the view output using the same content template as the page where it is placed?

Finally would you mind allowing me to have admin access to the site to check on this one for you ?

Thanks,
Shane

#1401937

Hi Shane,
Yes. Please find the admin access:

#1402963

Shane
Supporter

Languages: English (English )

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

Hi Puneet,

The problem is here in your view.
hidden link

In the view template you are calling back the view itself which produces an infinite loop because of the content template being called.

What I recommend that is you remove the call for [wpv-view name="search-view" limit = "1"] in this view.

Please try this and let me know if it helps.
Thanks,
Shane

#1403777

Hi Shane,
Yes it is helpful.
My issue is resolved now.
Thank you!

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