[Resolved] Split: issue with offset shortcode on homepage
This thread is resolved. Here is a description of the problem and solution.
Problem:
Posts are being submitted by a Form but they do not appear in a View which shows the latest submissions.
Solution:
The View includes a Query Filter to show posts with a custom field set to a particular value, but the Form that publishes the posts doesn't include that field.
This support ticket is created 6 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.
Hey, man. There's something else that's weird going on in there too, now. I have a view for the homepage that queries the equipment-listing CPT. It returns 1 and I offset it with a shortcode on the homepage. When I make a new listing, the homepage (for weeks now since I created it) has always worked well and would put the new listing in the offset='0' (+1 +2 etc) on the homepage as soon as I made the post. Now... I make a new post and the homepage isn't picking it up. If I edit the post (2 times).. it shows up. Is this somehow related? I took the code that disables AJAX back out (so it's normal) and it makes no difference. It's really weird and just came out of no where. :/ Any help with that would rock too. 🙂
I looked at your home page and see where you are using the View with offset to show each of the 3 latest posts individually.
I created a test page ('toolset'), and I did the same, as well as inserting the View with a limit of 3 to just show the latest 3 posts, and see the same results.
So I have been messing around with this for the past two hours. I've found the following out:
The only way this form works "correctly" now is if I use 'auto generate form', and don't touch or change anything.(as far as pulling the listings on the home page)
If I use the ajax form creator and 'move' anything at all, it does not work (as far as pulling the listings on the home page)
If I use the auto generate and then move the code around in the text editor, it does not work (as far as pulling the listings on the home page).
Also.. in all of this.. now, out of no where and only working on trying different things with only the post form, [it] has deleted every term from my 'years' taxonomy that wasn't in current use on a post. I had them, as you should be able to see on your end, from like 1980 something all the way up to 2020. They're gone...... 🙁
Just giving you a heads up on what I've found trying to fix this thing.
Sorry Jason, I'm being a bit thick. I can see you have a form "Site Listing form" to submit equipment listings, but I can't see it on the front end. Where is it inserted?
I took a quick look at your site and can see that the unassigned year terms are missing, which is very odd behaviour that I can't readily account for, but I'll keep an eye out for it in my testing.
Your View contains a Query Filter "Select items with field: Is Sold is a string equal to 0"
Your Form which publishes the equipment listings doesn't include the is-sold field.
So a newly submitted post has no value for is-sold, and so fails the Views Query Filter.
Were you to edit the post in the back end and save it, the is-sold field would get saved with a zero value, and hence it would start showing up in your View.
In my test submissions I didn't see any issue with the disappearing year terms.