This is for future askers,
Whenever you use query_posts or custom wp_query you should add wp_reset_query(); after your loop or when you are done processing your posts. This little line of code will help in solving pagination issues or in your case rest the global $post the original as before your query.
Related Posts:
- Apply the_title() filter in post & page title, but not in menu title
- The next_posts_link() works only with original $wp_query
- Skipping first 3 posts in wp query
- Adding Post Counts to Menu (Nav) Programmatically?
- Pagination not working on Custom Page Template
- Is it possible to show a different WP menu when using password protected pages?
- Edit menu item title from edit page/post
- WP_Query do not load specifed number of post
- Disable most recent & view all (TABS) on nav-menu.php
- How to insert 2 args into 1 Wp_Query for a slideshow
- disable Tab post on nav-menus page (Admin)
- WordPress post filter menu
- Making a new post visible on a specific page
- Go back to the exact post page number
- How to create page with post content in it?
- Parent menu item does not display posts when I add the sub-items
- Page with Category Returning 1
- Using WP page password protection as defacto login
- I lost the link to my posts in my menu bar
- Is it possible to query a category with specified posts?
- Is there a global page/post/product/anything ID?
- Page and Posts loading as index page? Not loading the content
- Call posts of particular category in a page
- Add custom class to existing menu items from custom meta
- The next_posts_link() works only with original $wp_query
- Limit amount of pages shown in pagination within wp_query
- How to make posts appear under pages
- Adding a post to a page
- Should we trust the post globals?
- how to limit edit_form_after_title hook to page and post edit only?
- Querying post from a multisite network
- post__in for get_posts with a dynamic array
- Create custom page in WooCommerce
- Change WordPress post-state in Admin Area
- Working Bootstrap Carousel Conversion to WP – Technical Questions
- Hide add new page button
- How do I create an archive page for standard posts?
- How To Keep Posts from Being Displayed Two or More Times on My Homepage? [closed]
- WP_Query posts_per_page ignored
- How use %like% in sql statement wordpress
- wp_query ‘s’ parameter does not work with custom post type
- Mark menu item as current-menu-item for category
- WP Query – duplicated posts once including tags in search results
- how to get posts ids inside pre_get_posts filter?
- Blog Posts in Custom Menu
- How do I use WP_Query to get a range of posts with custom fields that have numbers with letters in them?
- How do I get blog posts to appear within CMS?
- recent posts for different categories
- Drag posts and pages so you can sort them in order
- Setup a custom dynamic post
- Anyway to grab author name and featured image in an embeded in inital array of posts outside of loop?
- Removing noindex posts from wp_query
- One menu for frontpage (one pager), and a different menu for posts
- Exclude the first ‘n’ number of posts of a tag from home page?
- Start post pagination at 0 instead of 1
- wp_posts table: safely remove unused columns to save database storage
- Display Posts on Custom Page
- Possible to alternate between two loops
- “about us”, ” contact” sections should be article(post) or page in the simple small Business website?
- Is it possible to use WP_Query to only pull posts with attachments?
- Parsing Menu Items and Blog Posts
- Every second post different class in blog view
- Display posts of specific category term
- wp_query with ajax
- Use posts_where to exclude posts ids from wp_query
- How to get main menu only with wp_nav_menu
- Why does WordPress search returns same number of results for every search query?
- Setting limit to posts or page creation
- post/page content
- WordPress Architecture as a CMS – Posts & Pages
- Is it to possible to insert a page in the post depending on the category ofthe post
- How can I add a page that shows posts from a single category?
- Override WordPress core post-template.php block template
- Menu Items disappearing/being empty on save or post edit
- Display/Filter post using if else statement
- Search results for ACF data
- Nestling Posts Under Page & Justify Text
- Numbered Pagination Showing The Same Posts After Altering WP_Query
- Loop through all posts showing duplicates
- Manipulate query to show specific post
- WordPress text field in array problem
- Random order of the 5 most popular posts
- My custom query is displaying random posts in random order
- Get query result according to merged array
- How to show the posts list into a static page? Problems to use the loop into a static page
- Allow users to create their own page/s
- Displaying Results From Custom Taxonomy Query
- Make Show Notes for Individual Podcast Episodes Easy to Find (multiple URL’s?)
- Multiple loops on a Search result page?
- Displaying only posts from a certain category on my custom page template
- WP_Query: Fetch posts that are in (category1 and not in category2), OR posts that are not in cagegory1
- How do I show the post title if an advanced custom field hasn’t been used?
- Custom post page has attributes of latest post [closed]
- WordPress “Posts Page” isn’t showing template dropdown
- Adding Count Post in Page
- How do I hide single category post on my post page
- How to have 2 posting pages on a blog
- How add class the_content();?
- change page name on page list
- WP_Query post_tilte search in posts table