Skip Navigation

[Resolved] 2 Post Types in 1 view

This support ticket is created 7 years 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
- 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)

This topic contains 4 replies, has 2 voices.

Last updated by randallH-3 7 years ago.

Assisted by: Minesh.

Author
Posts
#593253

I am trying to create a view that will display 2 post type side by side.


[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-conditional if="( '[wpv-post-type]' eq 'proof-point' )"]

<div style="width:50%; float:left;">
[wpv-post-body view_template="visible-item-proof-points"]
</div>
[/wpv-conditional]

[wpv-conditional if="( '[wpv-post-type]' eq 'briefing' )"]

<div style="width:50%; float:right;">
[wpv-post-body view_template="visible-item-briefings"]
</div>
[/wpv-conditional]

</wpv-loop>

<!-- wpv-loop-end -->
[/wpv-items-found]

[wpv-filter-start hide="false"][wpv-pagination class="pagi1"]<center>[wpv-pager-prev-page][wpml-string context="wpv-views"]← Previous [/wpml-string][/wpv-pager-prev-page][wpv-pager-nav-links ul_class="pagination1" reach="2"][wpv-pager-next-page][wpml-string context="wpv-views"]Next →[/wpml-string][/wpv-pager-next-page]</center>[/wpv-pagination]
[wpv-filter-end]
<p style="height:20px;"></p>
[wpv-layout-end]

I want to make the first post type to the left and the other one to the right and show only 5 of each on pagination.

I tried creating on using the loop mentioned above.

Any other workarounds that I can work on to make it function?

#593269

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - the best way to implement such functionality is to create two views, one for your each post type and display it accordingly. I hope this makes sense.

#593275

Hi Minesh,

The reason is the filtering. I want to create 1 filter for the 2 post types. I created 2 views and added it to 1 view to make the filter work, unfortunately, not working.

Thanks

#593348

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Sorry - what you would like to filter. That way it will not work.

You can not divide the loop into two section. Best way is to make two views and display both view's independently.

More info:
=> https://toolset.com/documentation/user-guides/view-layouts-101/
=> https://toolset.com/documentation/user-guides/displaying-content-using-grids/

#593691

Resolved. Not possible with Views.