Skip Navigation

[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 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.

This topic contains 9 replies, has 2 voices.

Last updated by jasonw-2 2 years, 7 months ago.

Assigned support staff: Nigel.

Author
Posts
#1106493

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. 🙂

#1106510

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Jason

I'm not sure how to reproduce the issue.

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.

Do I need to submit a post to see the problem?

#1106720

Yes to submitting the post. 🙂

#1108397

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Jason

I've taken a copy of your site to install locally, because yours is a live site and I need to be able to submit test posts.

I'll get back to you.

#1108729

I don't have a problem with that, Nigel. There for sure is something goofy going on with it.

Thanks, man. \m/

#1108865

Nigel,

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.

Thank you for the help.

#1109496

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

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.

#1109525

Nigel. The link to the post form is in the top menu (list). also /list/

Thank you. I'm getting nervous about this. 🙂

#1110533

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Jason

The issue is simple enough.

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.

#1110684

Oh, geeze. My degen brain disease got the best of me on that one (I have onset Parkinson's).

I should have been able to catch that.

Thank you, Nigel. 🙂