Try to put your post slugs in an array for the post_name__in parameter:
'post_name__in' => [ 'berlin', 'frankfurt', 'munich', 'augsburg' ],
Related Posts:
- Should we trust the post globals?
- Get first post from wp_query
- How to automatically generate a unique random slug
- Querying post from a multisite network
- How to query serialized array by comparing greater than (>=)?
- How to know if get_posts() failed?
- Show related posts by category but ignore one category
- post__in for get_posts with a dynamic array
- Query posts distinct authors
- How to get previous 10 days post from a specific date – WP Query
- Determining Slug Before and After Edit
- Post content being duplicated by the_content();
- How to update all post at once?
- Specific loop in Shortcode
- Sort posts by activity date
- How to add padding between posts
- prevent showing posts of an specific category in admin posts section
- Working Bootstrap Carousel Conversion to WP – Technical Questions
- Search widget breaks when using multiple loops?
- How to change bulk post status
- Add few specific post ids to wp_query
- generate unique slug while inserting post
- Display posts with comments closed, with pagination?
- WP_Query posts_per_page ignored
- WP Query related posts by current page Tag ID
- I want to query posts in monthly basis
- Custom WP_QUERY $args
- WP_Query get posts from custom posts by category
- Accessing post->ID outside of the loop for listing child pages
- Limiting the number of posts in WP_Query leads to unexpected result
- List posts in a given category
- Reset Popular post query?
- Query Posts multiple conditions
- Future post ID not showing
- Why WP_Query(‘showposts=5’) shows only 1 post?
- Search by post title and content in wp_query without order
- How to do set post permalinks using 6 digit random unique function?
- How safe is renovating $wp_query when doing WP_Query pagination in Page Template
- how do i add posts-page slug before posts slug in permalinks
- wp_posts table: safely remove unused columns to save database storage
- Query Posts by Custom Field
- how can i change WP main archives loop to sort by name or title
- Using wp_list_pages() after calling query_posts()
- Why are my paginated posts always returning the same results?
- Inner join overrides Advanced Custom Fields plugin’s get_field [closed]
- Loop doesn’t exclude the specified category in home page
- why the same code got different results when using query_posts in functions.php and index.php
- Query posts by Author and/or by Tag
- Replace image name on upload to the new post name on front-end form
- Migrate posts from category and sub-category via SQL
- How do I insert a after every 5 posts in a WordPress Loop that infinitely loads posts?
- WP_Query: Show 10 posts in date order, first three random
- Exclude some posts from displaying in wp_query based on some condition
- WordPress Loop: How to display recent posts in multiple divs
- Random posts that always include a particular post?
- Auto update post title and slug when post status is changed
- Conflict array_splice on loop and query in widget
- WP_Query of Category Not Showing First Post
- Change content off every sixth element
- WP_Query get posts in custom database table [duplicate]
- WP query taxonomy optimization
- WordPress Query – Display 5 posts (same post type), each from a given tag
- While loop in functions.php outputting the_title() of each post on frontpage
- Show posts from two specific category in WP_Query
- How to create loop of posts except post ID defined via ACF field
- Get post slug and match with menu item slug to change css
- Displaying all posts from other sites on the network on one site
- Multisite how to display merged posts from two sites and sort by latest date?
- Numbered Pagination Showing The Same Posts After Altering WP_Query
- a WordPress connected to 2 database
- Using a meta_value or postdate to to query and orderby
- Exclude posts in home slider from sections
- WP_Query that targets all categories
- Fill the exclude array() in get_posts()
- Double loop output
- Ajaxify Post Sort
- Get current user, change users post status to published
- Displaying a specific sub-category’s posts from wp_query
- Custom layout manager for posts
- Display WordPress Post By Date
- GUID to related post not in current language
- Post as frontpage – avoid duplicate content
- Get results from the main wp_query
- How can I display a specific number of post in a category via a url
- Advanced Post Display/Pagination/Ordering
- Pagination for custom query won’t let me back on page 1
- Make assigning post to a specific category equivalent to assigning it to all categories
- WP_Query retrieve custom posts but not the post showing
- WP_Query based on a custom field result
- How to get single post by one author?
- Echo author slug in post edit page
- List posts related to category on a div [closed]
- WP_query sort by custom meta_key “price”
- Wp_query WooCommerce products
- posts_per_page – Repeats only first posts ‘post__in’ array
- query_posts different amount of posts per page [duplicate]
- Add custom PHP (no-SQL) filter to WP_query
- Filters do not work when there are multiple (one works)
- date_query returning only the most recent post instead of the post published before today
- How to make WP_Query faster when getting a post from one year ago?