Skip Navigation

[Fermé] View does not display correctly when using content template

This support ticket is created Il y a 3 années et 11 mois. 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
- 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 1 réponse, has 2 voix.

Last updated by Waqar Il y a 3 années et 11 mois.

Assisted by: Waqar.

Auteur
Publications
#1640023

Hi there,

I have created a post view and it is working fine in various places where I have inserted it, e.g. see the "Buying Spanish Property" section on this page: hidden link

My view uses a content template for the loop.

I have inserted the same view on my 404 page, see: hidden link

I have tried this a couple of ways, both with the same unsuccessful outcome. One way is to render the view from my 404.php template. The other is to use a content template (to which the view is inserted) and then render the view_template from my 404.php template.

You see it does not respect my format - no featured image or title. Instead it shows the excerpt.

I have seen this problem a number of times whilst building sites. I have been able to work around it by switching the loop content template for the actual html/shortcodes.

I tried that here and it did not help.

#1640953

Waqar
Supporter

Languages: Anglais (English )

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

Hi David,

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

During my initial tests, I couldn't reproduce this issue on a test website. I created a post view, with the heading block and the image block for the featured image in the loop.

Next, I called that view directly in the theme's "404.php" file using the "render_view" function ( ref: https://toolset.com/documentation/programmer-reference/views-api/#render_view ) and also through a separate content template, using the "render_view_template" ( ref: https://toolset.com/documentation/programmer-reference/views-api/#render_view_template ) and it showed the correct loop blocks, each time.

To troubleshoot this, I'll suggest the following steps:

1. Please make sure that WordPress, active theme, and plugins are all updated to the latest versions.

2. It would be interesting to test this with all non-Toolset plugins disabled and a default theme like Twenty Twenty.

If it's fixed, you can start adding the disabled items, one-by-one, to narrow down to a possible conflicting one.

3. In case the issue still persists, I'll need to see how this view is set up and is being called on the 404 page, in the backend.

You're welcome to share temporary admin login details in reply to this message.

Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.

regards,
Waqar

Le sujet ‘[Fermé] View does not display correctly when using content template’ est fermé à de nouvelles réponses.