Skip Navigation

[Resolved] wrong view is displaying

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

Problem:

Some other plugins/theme/custom codes is changing the outputs of shortcode [wpv-post-body].

Solution:

You can add attributes suppress_filters="true" in shortcode [wpv-post-body], for example:

[wpv-post-body view_template="None" suppress_filters="true"]

Relevant Documentation:

https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-body

This support ticket is created 6 years, 1 month 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 – 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/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by Gretchen Louise 6 years, 1 month ago.

Assisted by: Luo Yang.

Author
Posts
#1188407

I am trying to: figure out what happened to my views/templates after some recent updates to Toolset plugins

Link to a page where the issue can be seen: hidden link
I expected to see: a perspective type displaying instead of the actual post re-displayed

On this page hidden link the purple box should be showing one single "perspective" post type but again it's showing the existing page.

It's like instead of "Don't include current page in query result" it is ONLY including the current page in the query result.

Help!

#1188814

Hello,

Thanks for the details, I assume we are talking about the post view "Perspective (random view)"
hidden link

It is querying "Perspectives" posts, but in front-end, it display a blog post:
hidden link
But what has been clear to me since I met Andrew

This is abnormal, please check these:
1) In case it is a compatibility problem, please backup your website, deactivate other plugins, and switch to wordpress default theme 2019, and test again
2) If the problem is fixed, you can locate the problem plugin/theme by activating them one by one.

#1189324

I'm sorry, but I don't think that it is a theme or plugin conflict. It worked fine before the recent updates to the Types plugins.

On this page hidden link I can see this error where it's trying to call the page contents a third time:
Content not displayed because it produces an infinite loop.
The wpv-post-body shortcode was called more than once with the attribute view_template="None" over the post "Love Stories", triggering an infinite loop.

And on this page hidden link there are these errors over and over:
Content not displayed because it produces an infinite loop.
The wpv-post-body shortcode was called more than once with the attribute view_template="Perspective Display" over the post "My favorite love stories are true ones", triggering an infinite loop.

Can you please help me figure out how my views are triggering an infinite loop?

Thank you.

#1189499

Thanks for the details, here are what I found in your website:
1) In the URL hidden link, it is displaying an view's shortcode:
[wpv-view name="perspective-display" limit="1"]

2) It is the same view as I mentioned above "Perspective (random view)", see it here:
hidden link
There two [wpv-post-body] in this view:
- section "Loop Editor": [wpv-post-body view_template="Perspective Display" ]
- section "Perspective Display": [wpv-post-body view_template="None" ]

And you have setup them correctly, unless some other plugins/theme/custom codes change those outputs, so I have edit above view, change both shortcodes, and add attributes suppress_filters="true" in both of them:
- section "Loop Editor": [wpv-post-body view_template="Perspective Display" suppress_filters="true"]
- section "Perspective Display": [wpv-post-body view_template="None" suppress_filters="true"]

And test it in front-end again:
hidden link
It works fine, so there should be a compatibility problem in your website, some other plugins/theme/custom codes is changing the outputs of shortcode [wpv-post-body], I am not sure which one is the problem, you can try to locate the problem plugin/theme as I mentioned above:
https://toolset.com/forums/topic/wrong-view-is-displaying/#post-1188814

1) In case it is a compatibility problem, please backup your website, deactivate other plugins, and switch to wordpress default theme 2019, and test again
2) If the problem is fixed, you can locate the problem plugin/theme by activating them one by one.

And the workaround is using attribute suppress_filters="true" , see our document:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-body

suppress_filters (opt):
'true' | 'false' (default)
If suppress_filters=’true’, all third party (non WordPress) filters hooked into the_content filter will be removed, when retrieving the post body.

#1190594

Thank you. That's what I needed!