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
- Is it possible to change post id for an already added menu item in WordPress?
- Blog post per page setting conflicting with custom WP_Query?
- Change post order random through out the entire WordPress
- How to exclude latest x posts from a paginated query?
- How to create a submenu that will navigate through different posts in the same page
- Setup a custom dynamic post
- Adding buttons to Add New Post and Add New Page
- Anyway to grab author name and featured image in an embeded in inital array of posts outside of loop?
- How to verify wp user password by sql query in wp? [closed]
- Removing noindex posts from wp_query
- WP Query – Posts Per Page not working in combination with category__in
- Ajaxify This Code
- How to filter my search in post if contains a word in title, content or excerpt?
- More then one menu items are assigned with “current-menu-item” class
- How to return another post than requested
- Pausing and Resuming WP_Query results
- How to do set post permalinks using 6 digit random unique function?
- Select only post id and meta value with WP_Query
- Lost draft under all posts and drafts
- Post categories to pages
- Switch to page template when using post permalink
- Get user categories with most posts in it
- One menu for frontpage (one pager), and a different menu for posts
- 301 (static page instead latest posts)
- Integrate OpenStreetMap on WordPress
- Random ajax load only works with posts_per_page set to -1
- What’s the best way to render Visual Composer in posts, not pages?
- How to : pagination in 3 different custom loops on the same page
- How to handle broken links created by permalink/slug changes?
- Get Page ID of blog homepage
- Static posts page with home.php
- How safe is renovating $wp_query when doing WP_Query pagination in Page Template
- Second comments section for one post/page
- Exclude the first ‘n’ number of posts of a tag from home page?
- Query posts and return XML
- how to change the number of posts returned in a specific loop without making it global?
- How to list recent posts in a wp nav menu?
- Query Posts With Over 1000 Views
- posts_per_page option limits the number of Gallery items
- List authors with the last post title and order by last post date
- How to order posts by meta_value and title
- 404 error on default post type and default taxonomy fronted page
- Overwrite posts/pages via import
- Auto-realod with new posts // Ajax call
- When open add new post or page WordPress add post with ID=0 continuously [closed]
- Start post pagination at 0 instead of 1
- Hooking into the post editing screen for an existing page only
- wp_query random post
- wp_posts table: safely remove unused columns to save database storage
- Query Posts by Custom Field
- Adding a blog archive with pagination using WP_Query
- How to get Tags with specific post id
- Redirect to another page using contact form 7? [closed]
- how can i change WP main archives loop to sort by name or title
- How do I do a page break?
- Is there a way to specify an extra class for a post or page with no title?
- Automatically create a new page daily with last three posts
- how to get post order by post id wp_query?
- When changing pages to posts, how do you set up 301 redirects for the page URLs?
- Display Posts on Custom Page
- Possible to alternate between two loops
- Show posts count for Categories and Tags in wp_nav_menu
- How to add category post count in main navigation menu [closed]
- User Selectable Delete of Pages
- Nested WP_Query breaking loop
- WordPress query_posts by tag doesn’t work anymore(?)
- 2 dynamic sidebars registered, not showing up
- Multiple Loops Breaking Pages
- “about us”, ” contact” sections should be article(post) or page in the simple small Business website?
- How to get ID of the page included with get_page()?
- Posts vs Pages and categories
- Including link to custom post type in ‘wp_list_pages’ function