Mixing 2 custom post types with posts output in specific pattern

Since jet engine works on Elementor, you can add a custom query filter

This may sound a bit complex, but it can work for your case.

  1. Add a hook that on save post will create a array of articles and ads in the order you want. Store the post Ids in a transient.

  2. In the Elementor query filter, get the post id’s from the transient, and rested the query args to be post__in with the post ids from the transients.

  3. In the jet engine widget, set the filter ID and you will get the posts you set.

The reason transient is better than query inside the filter, it will avoid you gettings loops of error maximum depth when you set a query inside a query. Also it will be faster.

Elementor custom query filter

https://developers.elementor.com/custom-query-filter/

Save post hook

https://developer.wordpress.org/reference/hooks/save_post_post-post_type/

Transients

https://developer.wordpress.org/apis/handbook/transients/