Home › Toolset Professional Support › [Resolved] The view is empty
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 |
---|---|---|---|---|---|---|
- | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10: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/Kolkata (GMT+05:30)
Tagged: Views API, Views plugin
Related documentation:
This topic contains 19 replies, has 2 voices.
Last updated by Franck 5 years, 10 months ago.
Assisted by: Minesh.
Hello,
I'em trying to use API to show view.
On my function file i have this code :
test();
function test() {
$filtered_posts = get_view_query_results( 5333 );
//print_r($filtered_posts);
foreach ( $filtered_posts as $filtered_post ) {
//$lien = types_render_field( "pt-theme", array('id'=>$filtered_post->ID, 'output'=>'raw'));
}
print_r($filtered_posts);
}
And on my site i have an empty array.
Strange. Because when i use the same view on the front it is working :hidden link
Thanks for your answer.
Hello. Thank you for contacting the Toolset support.
Well - when you say that the view is working on the following page:
=> hidden link
Do you mean that you want to see the message "Bon Voyance Gratuit" message or I misunderstood something here?
Hi,
No i just want $filtered_posts is not empty because i couldn't be empty.
Do you think there is a problem in my code to use API ?
Well - I can tell you once I can review your current setup.
*** 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.
I was looking at the view you shared:
=> hidden link
The view is attached to post type as well as Repeating field group as well that is not correct.
I checked the page where the view is added - the view do not display any records there.
=> hidden link
Can you please let me know what entry you are looking to display there. Do you also want to display associated Repeating Field Group as well?
The view display something as you can see in my picture.
Well - just checking with you. are you working on the site? I see now page is not displayed. It asks me every time to assign the Layout.
No, i don't work on website
I've created "toolset-test" page and when I preview it - it displays "no items found" - is this correct?
=> hidden link
I just do not able to assign the Layout to this page.
Or
Can I have same test page where you assigned the layout?
It is really strange.
You have changed the view and you say it is not working.
I have re-updated the view and it is working.
hidden link
I added argument because with the cache cloudflare
Is it possible for you to disable the cache untile I work on this issue, as it seems cache issue that is why changes I make do not apply or I see strange results.
I am sorry, but we have a really big trafic and i can not 🙁
But can just add something after url... it is the same thing, no ?
Well - there is something really strange going on - for now it looks like from cache:
I removed the view and just trying to display the plain text "nice" added to the text editor:
=> hidden link
On frontend - I still see the word "Bon Voyance Spéciale Gratuite":
=> hidden link
Please check the following screenshot:
=> hidden link
Me i just see "Nice" as you can see.
This is really strange - now even I can see only "nice" word. Please see the screenshot:
=> hidden link
So that means whatever changes we make takes some time to have the effect.
The screenshot you shared here with shows the unwanted text:
https://toolset.com/forums/topic/the-view-is-empty/#post-1213616
Even I was seeing the same text when I send you the screenshot with my previous reply:
=> hidden link
But now, the unwanted text disappears as you can see now:
=> hidden link