You need to post the query code of both the post query and the gallery query; no one can really make a guess otherwise.
You can try using <?php wp_reset_query(); ?>
after the post query to force a reset.
See http://codex.wordpress.org/Function_Reference/wp_reset_query
Related Posts:
- Exclude posts with empty post_content in wp_query
- Improving WP_Query for performance when random posts are ordered
- Query for first 3 posts to change the look and feel
- How to give classname to post if post has no content?
- Show 5 posts and than 3 posts offset with pagination
- Sort / Filter Queries
- Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?
- Why I have this strange behavior when I try to exlude the featured post from posts visualization?
- How to limit the number of posts that WP_Query gets?
- Should we trust the post globals?
- Random sort within an already sorted query
- How to exclude latest x posts from a paginated query?
- How to know if get_posts() failed?
- Query posts distinct authors
- How to get previous 10 days post from a specific date – WP Query
- WordPress Number of Posts Not Changing With posts_per_page
- How to add posts to wp_query result?
- Order post by year DESC and month ASC
- Should ‘setup_postdata()’ be reset with ‘wp_reset_postdata()’?
- Search query – exact post title match
- Hiding posts in a list from specified categories
- posts_per_page doesnt work
- How would I get 1 latest post from a query for 5 posts?
- How to start with post number x?
- Only display a certain number of posts, dependent on how many posts there are available in a query
- Should $found_posts be returned as string in ‘found_posts’ filter hook?
- Reset Popular post query?
- Get Posts that are in the current month or later
- Why WP_Query(‘showposts=5’) shows only 1 post?
- is there a way to show the the post title after the image?
- Blog post per page setting conflicting with custom WP_Query?
- How to exclude latest x posts from a paginated query?
- Random ajax load only works with posts_per_page set to -1
- Exclude the first ‘n’ number of posts of a tag from home page?
- wp_posts table: safely remove unused columns to save database storage
- Query Posts by Custom Field
- Nested WP_Query breaking loop
- WordPress query_posts by tag doesn’t work anymore(?)
- Why Query is returning empty array?
- Inner join overrides Advanced Custom Fields plugin’s get_field [closed]
- meta_value timestamp older than now
- Counter is skipping post when I still want it visible [closed]
- Do not show children of a category
- why the same code got different results when using query_posts in functions.php and index.php
- How to get posts published on the latest date?
- Why posts array is empty?
- How to check in functions.php if there is data in a WP_Query?
- Shortcode with ‘year’ parameter
- On what hook can I get the queried object’s final state?
- wp_query with ajax
- WP_Query: Show 10 posts in date order, first three random
- Exclude some posts from displaying in wp_query based on some condition
- Random posts that always include a particular post?
- Related Posts function not working
- How to retrieve certain number of images from a wordpress post?
- WordPress post filter menu
- How to convert query sql to shortcode in wordpress?
- Query function not executed between element [closed]
- Echo the number of posts being displayed
- WordPress query portfolio posts
- Display 3 posts with different HTML markup using a loop
- Change content off every sixth element
- How Can I Always Display A Particular Post First Using WP_Query?
- WordPress Query – Display 5 posts (same post type), each from a given tag
- Show posts from two specific category in WP_Query
- How to create loop of posts except post ID defined via ACF field
- Displaying all posts from other sites on the network on one site
- How to fetch courses in all languages in WordPress?
- Multisite how to display merged posts from two sites and sort by latest date?
- show image gallery in archives or category page
- filter posts based on menu_order
- wp_query args with relation
- Manipulate query to show specific post
- Querying posts from current category, using a variable as array argument
- Sort Events by Venue Title – Sort Post set by related post ids
- wp query custom orderby not custom field
- Query post category & remove any post id
- Advanced Post Display/Pagination/Ordering
- Ordering posts alphabetically by meta keys and title
- How do I control the fallback query after the original query returned cero posts?
- Remove duplicated posts in the loop if post has more than one category
- Adding a category at even positions on main loop with modified pagination
- Query Posts From Multiple Post Types
- Displaying Results From Custom Taxonomy Query
- WP_Query retrieve custom posts but not the post showing
- wp_query select if have comments
- Creating pages and getting their values from the database table
- How to limit post query to only return a total count of items with certain post statuses?
- Wp_query WooCommerce products
- query_posts different amount of posts per page [duplicate]
- Sort Posts Alphabetically Based on Specific Category (Divi)
- How can I display a specific user’s first published post?
- How to implement time filter to show random post 1 month for one category and 3 months for other categories
- How to hide first gallery for every post?
- How can I sort posts by the date and a custom meta field?
- How to get Tags with specific post id
- how to handle the loop using filling bootstrap grid structure?
- How to display WP Query filters?
- Move position in post list for a custom checkbox column
- show latest authors blog post