Skip Navigation

[Resolved] View's loop item completely ignored in the output

This support ticket is created 4 years, 3 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 – 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 5 replies, has 3 voices.

Last updated by nelsonT-2 4 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#1399201

Hi,

I'm facing something I've never seen before...

I'm trying to work on a client site... She has started it few years ago, then put it aside, and lately put some time back on it to release it... So, she started by using her old method of creating custom template files (ex: page-cours-de-dressage.php) to create her layout... She probably wasn't using Toolset at the time...

Now, I'm trying to create a View that will output in a table the post's title, date and a couple of other information... So, I created my View as expected, but the output is simply all the posts one after the other... And then, at the end, I have my empty table! In other words, it takes what's inside the first part to get the ENTIRE articles in the loop, and then just takes the first part's code (the loop declaration that creates the table and row tags) to show the empty table... The loop item, that looks like that for now:
<td>Quiz pour "[wpv-post-title]"</td>
<td>Publié le [wpv-post-date]</td>
[wpv-conditional if="( '[wpv-user field="ID"]' eq '1' )"]
<td colspan="2"><a href="[wpv-post-url]#quiz">Répondre aux questions</a></td>
[/wpv-conditional]
[wpv-conditional if="( '[wpv-user field="ID"]' neq '1' )"]
<td>Article dressé</td>
<td>Note</td>
[/wpv-conditional]

is completely ignored...! I don't know if it's due to a specific template that she created or not... By the way, when I use a custom type created with Toolset, it works as expected, but if I use something else (posts, pages, medias...), then it bypass the loop item...

Any idea what could cause that? Is there a specific template that each iteration of the loop is taking that I need to modify?

Thank you.

P.S. It's on a staging site (so I can hardly share, and it uses the default wordpress url; like name/?page_id=2.

#1399475

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

As you said, you created a PHP template, is your page is still using the PHP template? if no, the page where you added the view you just created is using any content template?

Can you please share the problem URL and if possible access details so I can troubleshoot this further.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1400405

Hello,

Minesh is on vacation, I will take care of this ticket.

I can log into your website, and when edit both post ("Test articles") and page ("Test page"), I see blank screen, so there might be some PHP errors in your website, please try to fix them first:
1) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2019, deactivate all custom PHP/JS code snippets, and test again

2) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

And in the view "Cours de dressage" you mentioned above, the shortcode [wpv-user field="ID"] should output current logged in user' ID, and there is a wrong setting in your codes, please edit this line, from:

[wpv-conditional if="( '[wpv-user field="ID"]' neq '1' )"]

To

[wpv-conditional if="( '[wpv-user field="ID"]' ne '1' )"]

And test again.

#1400927

Well, I'm completely stunned right now...

First, for the two pages, you can forget about the "Test articles" post... For the "Test page" page, it was a draft, so I published it... could that be the reason you saw an empty page? For the main page ("Cours de dressage"; hidden link), I did some progress...

With the View debugger, I can see that the first one returns what is expected (at least when I show just two... seems to be different otherwise) but the second one retrieves the post... It is then on the page put on top and the table (i.e. first one) below it...

What I have also found is that the problem seems to come from a problem with Elementor: as soon as I deactivate it, it works as expected (even though that page doesn't even use Elementor)... So, Elementor strangely adds something to the non-Elementor page when we call the articles... It's really JUST on that site, as I use Elementor on many sites and it never does that... Again, might have to do with the custom templates made in PHP (not Elementor)...

The template I'm trying to edit is page-cours-de-dressage.php in the Harmony Child 01 theme.

The other debugging techniques (PHP and JavaScript) didn't produce any results...

#1401315

I have done below modification in your website, edit the post view "Cours de dressage":
hidden link

in section "Loop Output Editor", replace the content template shortcode from:
[wpv-post-body view_template="Loop item in Cours de dressage"]

To:
[wpv-post-body view_template="Loop item in Cours de dressage" suppress_filters="true"]

This will remove the_content filters from third party plugins. Please test again, check if it is fixed. thanks

More help:
hidden link
If suppress_filters=’true’, all third party (non WordPress) filters hooked into the_content filter will be removed

#1401321

Woohoo! It's working perfectly fine!

Thank you so much for your time and support! Toolset support is just amazing!

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