I have two post types : 1) zadanie and 2) dis
"dis" posts contain custom field "artel" with numbers
need to show post "dis" with "artel" field which number equal to number of posts "zadanie" posted by current author.
Example: I posted 10 posts "zadanie"
need to display "dis" post which "artel" field contains number 10.
Thank you for contacting us and I'd be happy to assist.
To achieve this, you'll need two views created using the classic/legacy editor:
1. The first view will be set to show the 'zadanie' post type, with the post author query filter, to show only posts where the currently logged-in user is the author.
( example screenshot: post-author-filter.png )
To avoid any extra spaces or characters from the view's output, please uncheck the option "Disable the wrapping DIV around the View" and also remove the shortcode "[wpv-filter-meta-html]" from the view's "Output Editor" section.
2. The second view will be set to show the 'dis' post type, with the custom field query filter for the "artel" field, where it is the number equal to the shortcode attribute "artel".
( example screenshot: custom-field-filter.png )
3. When both views are ready, you can use the shortcode of the first view, as the value of the "artel" attribute, in the shortcode of the second view, for example: