Try to put your post slugs in an array for the post_name__in
parameter:
'post_name__in' => [ 'berlin', 'frankfurt', 'munich', 'augsburg' ],
Related Posts:
- How to limit the number of posts that WP_Query gets?
- Should we trust the post globals?
- Where is the old post permalink slug stored?
- The next_posts_link() works only with original $wp_query
- Use category base slug in posts’ permalink
- Adding additional data to WP_Post object
- Get current post id in functions.php
- Random sort within an already sorted query
- Custom Post Types, slug, archive and SEO plugins
- Get first post from wp_query
- WP_Query: Why is sticky post not first item in loop?
- WP_Query offset argument does not work
- Displaying the category name of a custom post type
- Query *only* sticky posts
- How to automatically generate a unique random slug
- Search by Hyphen
- Skipping first 3 posts in wp query
- Post slugs and images cannot have same name?
- Exclude drafts in all() view of edit.php
- Change the Slug of Post Type post to baseurl/post/%postname%
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- How do I reorder (pop and push) items from WP_Query?
- Accessing the post content with WP_Query
- Querying post from a multisite network
- How to exclude latest x posts from a paginated query?
- 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
- Keep getting same permalink with WP_Query?
- Reverse chronology of post listing
- How to control which category will be picked for the slug of a post?
- Query posts distinct authors
- WP_Query to work with custom view
- How to query posts with current or future date only
- Change slug with custom field
- How to get previous 10 days post from a specific date – WP Query
- WordPress Number of Posts Not Changing With posts_per_page
- Most viewed post for the last 2 days using WP_Query
- Adding Post Counts to Menu (Nav) Programmatically?
- Determining Slug Before and After Edit
- Pagination not working on Custom Page Template
- This AJAX Code Doesn’t Work – Looking for elegant solution
- Create new WordPress post [wp_insert_post] based on results of a WP_Query
- Post content being duplicated by the_content();
- Get only modified posts
- How to add posts to wp_query result?
- Posts for next month
- How to update all post at once?
- Exclude posts with specific meta_value while sorting by a separate meta_value
- 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
- How to output comments number of a post per day?
- Working Bootstrap Carousel Conversion to WP – Technical Questions
- The next_posts_link() works only with original $wp_query
- What is wrong with this wp_query?
- wp_query select if have comments
- WP_Query: Fetch posts that are in (category1 and not in category2), OR posts that are not in cagegory1
- WP_Query based on a custom field result
- How to get single post by one author?
- retrieve post slug by post_tags taxonomy
- wp_query posts sorting doesn’t work
- Order by ‘s’ using WP_Query()
- Exclude sub sub categories from displaying in the archive page
- Limit amount of pages shown in pagination within wp_query
- Show all posts in category
- How do I show the post title if an advanced custom field hasn’t been used?
- custom sort posts in archive/taxanomy page
- Echo author slug in post edit page
- First post in loop displays twice
- how to print loops for odd in 1st column and even in 2nd column in wordpress [closed]
- List posts related to category on a div [closed]
- WP_query sort by custom meta_key “price”
- Trying to create shortcode listing custom posts, but formating not being included
- Wp_query WooCommerce products
- Show Title/Date/Excerpt of first post & only Title for rest in Query [duplicate]
- posts_per_page – Repeats only first posts ‘post__in’ array
- Get posts after calculating meta key
- Next and Previous buttons are not showing on home page for post
- query_posts different amount of posts per page [duplicate]
- How add class the_content();?
- Is there any point to using wp_unique_post_slug?
- How edit footer copyright info? [closed]
- Add custom PHP (no-SQL) filter to WP_query
- How do I get content of custom post type through post ID
- Filters do not work when there are multiple (one works)
- Get related posts matching most of the provided tags using WP_Query
- WP_Query post_tilte search in posts table
- date_query returning only the most recent post instead of the post published before today
- Image inside the content is replaced with featured image from my older post
- post loop with different design depending on post
- Show category name in category.php when posts assigned to multiple categories
- How to speed up WP_Posts_List_Table __construct() Query on a wordpress website with over 1 million posts?
- Implement AJAX ‘load more’ with offset posts
- Is it possible to use the_post 2 times in one loop
- Gutenberg block: add a multi-select for posts
- Order by Post Title in WP Query not working
- How to make WP_Query faster when getting a post from one year ago?