I try to create a view from two CPT's posts. My problem is that I want to show only 3 posts for each CPT in the same grid.
One is called destinations and should show the featured post that are set in a post field.
The other is called activities, and this should be show 3 random posts.
This wouldn't be possible if you were writing the queries in PHP with the built-in WP_Query class, and so is not possible in Views.
In either case you would need to create two separate queries.
So create one View which shows three featured destinations, and a second View which shows 3 random activities, which you can insert one after the other.
If that is problematic for some reason, let me know.
I have the two separate view, and I thought maybe I can put them one after the other because I need them in the same grid and I could style it with flex easily. But I have to get rid of this wrapper first:
<div id="wpv-view-layout-1653-TCPID1655"...
I will create this manually before and after the code block I put the two views shortcode in. So is there a way to have a view that just outputs my divs one after the other without the wrapper?
That's the issue I thought you might run up against, depending on your implementation of a grid.
You can produce a "naked" View output without the wrapper DIV using the following code, which you should add to your theme's functions.php file or using a plugin such as Code Snippets: