Skip Navigation

[Resolved] wpv-post-type – shows "Pages" rather than the post type of the view

This support ticket is created 4 years, 10 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by shawnW-3 4 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#1544747
wpv-post-type-outside-loop-2.JPG
wpv-post-type-outside-loop-1.JPG
wpv-post-type-inside-loop-2.JPG
wpv-post-type-inside-loop-1.JPG

Tell us what you are trying to do?
Show the [wpv-post-type show="plural"] outside of a loop.

Right now if it's outside a loop it renders "Pages", likely because the view is contained within a page.
However, if it's inside the loop it correctly renders the post-type, in this example, "Signal Processors".

Is there any documentation that you are following?
I searched thoroughly and couldn't find anything. I think it's a bug because this behavior doesn't make sense. If it's in the wpv-layout-start, I would think that should be sufficient to use the view's settings to determine the post type.

I hope I'm just using it wrong, but it looks like a bug.

Is there a similar example that we can see?
wpv-post-type-outside-loop-1: Shows the post-type rendering as "Pages"
wpv-post-type-outside-loop-2: Shows the post-type field is placed outside the loop (NOTE: I have also tried placing below wpv-items-found with the same result)

wpv-post-type-inside-loop-1: Shows the post-type rendering correctly as "Signal Processors"
wpv-post-type-inside-loop-2: Shows the post-type field is placed inside the loop

What is the link to your site?
Access Restricted

All Toolset versions are up to date.

Please try replicating, and if you need access, I can provide it.

Please assign this to someone in a US time-zone for faster response.

#1544807

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Shawn,

Thank you for getting in touch.

Actually this is not a bug. For clarity what is happening here is that Post data for a view is only displayed within the <wpv-loop></wpv-loop> tag.

This would mean that anywhere outside of this would render information for the Current Page that the view is placed on.

No post data for the loop is being added outside of this loop tag, hence why the wpv-post-type shortcode behaves in this fashion. Its the same for any other shortcode that we have.

Once they are not within the loop tags then they will give information for the current page that the view is on.

Thanks,
Shane

#1544915

That's a pretty big misunderstanding. I was under the impression that everything under wpv-layout-start was filtered by the view settings and that loop was only for the looping of filtered content. But I have gone back through all my views and this was apparently the first time I put that belief to the test.

So the question remains, how do I show [wpv-post-type show="plural"] one time only above the template for the looping content?

I tried the attribute - limit="1" - but nothing rendered. Making an entirely new view with a limit seems excessive.

#1544921

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Shawn,

Is you view only displaying one CPT?

If so then you can add a fixed text for the CPT for the view because there isn't a way to have the [wpv-post-type show="plural"] shortcode display only once.

So you will need to manually specify the text.

Thanks,
Shane

#1544931

True, in this case I am just doing on CPT, so there's not a significant need for the dynamic option, but it would have been one less thing for me to change when duplicating-versioning from one post type to another.

Please note that I had a separate and unrelated support ticket in before this one that hasn't been assigned.

My issue is resolved now. Thank you!