Skip Navigation

[Resolved] Most Recent Post Omitted From View

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/Karachi (GMT+05:00)

This topic contains 5 replies, has 3 voices.

Last updated by Waqar 1 year, 3 months ago.

Assisted by: Waqar.

Author
Posts
#2635437

The most recent CPT from my view is not shown once the filters are used at all. When I first load the view on the front end everything is great, but if I do anything with the filters even just hitting the reset button, but most recent CPT is no longer shown in the results. I don't have an offset in the view backend. I do notice that ?wpv_aux_current_post_id=827&wpv_aux_parent_post_id=827 is being added to the URL. I think what's happening is the page is being treated like it's the single post and not the view page so it's taking away the CPT out of the query. That id of 827 is the ID of the most recent CPT.

Any help is appreciated. Thank You and have a great day.

#2635617

Nigel
Supporter

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

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

Hi Oliver

If you turn on debugging mode for Views when you reload the page it will bring up a pop-up with details of the query that retrieves the results.

It should be possible to see why the latest post is excluded from the results in that case.

Go to Toolset > Settings > Front-end content under Debug mode.

I would double-check that there is no custom or 3rd-party code that may be modifying the query vars, so check if the problem occurs with a default theme and after disabling non-Toolset plugins and making sure you have no active code snippets set up in Toolset > Settings > Custom Code.

#2635773

Thank You for your response. I hope you are having a great day. I already know why the most recent listing isn't showing up. I mentioned it in my OP. The archive page is being treated like it's the ID of the most recent CPT of the view and being excluded. If I disable "Don't include current page in query result" on the view it works, but that is just a bandaid. I need to figure out why it's treating the archive page as the most recent CPT ID, but it's only after the filters have been used as described in my OP.

#2635951

Nigel
Supporter

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

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

Could you give a more complete description of your set up? We don't have enough details to diagnose the problem.

You have a View. You added the View to an archive?

What does the View display? What does the archive display?

The filters are part of the View or are part of the archive?

#2636311

Absolutely.

I have a custom post type of "keebs". I have a view for that CPT called "Keeb Showcase View". That view is set to display all the keebs with some filters. The shortcode for that view is applied to the archive of keebs on the front end.

When I first load the /keebs/ page which is the native archive page and houses the view, all the listings show up, but if I use the filters at all, even just hitting the reset button, the most recent keeb gets filtered out of the view.

i.e. after hitting reset "?wpv_aux_current_post_id=831&wpv_aux_parent_post_id=831&wpv_view_count=245-TCPID831" gets appended to the URL. 831 is the post ID of the most recent keeb. So the archive page is being treated as if it's the most recent of the CPT instead of the archive for those CPTs(keebs) and that is filtering out the most recent CPT from the view.

The post ID shown in the URL after hitting reset does change as the most recent post changes.

Thank You and please let me know if you need more info.

#2636395

Hi Oliver,

Thank you for sharing these details.

Based on what you've shared, what you're experiencing is expected, and allow me to explain.

The views are designed to work on single posts/pages, which have a fixed post ID.

The archives are technically not a 'post' so they don't have a post ID and they are a type of view or list on their own.

Now when a view is used on an archive page ( which is not its general intended use ), it picks the first available post ID from the results, to remember as a current page/post. And this is also used for exclusion, when "Don't include current page in query result" option is enabled.

Based on this it is a perfectly safe and reasonable solution to disable the "Don't include current page in query result" option when a view is used on an archive.
( since an archive is not a page/post )

I hope this explanation helps and let me know if you have any follow-up questions.

regards,
Waqar

#2636399

Thank You very much. I hope you have a great rest of your day.

This might not be the best place to mention it, but I've been waiting for a reply to my other ticket for over a week now: https://toolset.com/forums/topic/im-trying-to-make-a-view-that-only-shows-past-events/page/2/

It also doesn't show up under my open tickets list: https://toolset.com/forums/forum/professional-support/