You have to wp_reset_postdata()
after your custom loop to restore the global $post
variable.
Related Posts:
- Custom taxonomy archive page problem
- WordPress Query Posts From Category Post on Static Page
- How to add automatically bootstrap 4 order-lg-1 and order-lg-2 classes for columns in foreach loop based on the count?
- Querying another post category to match current post and display in loop
- Optimize CPT-function with a loop
- Custom Post Type Single Loop Outputting Wrong Post
- Custom post type – Loop out in random order but same 15 to appear first… still random
- Show Posts By Custom Field
- How to show the posts list into a static page? Problems to use the loop into a static page
- How to show only the date, the title and a little “summary” of my WordPress post in my custom theme?
- How to display by default only published posts/pages in the admin area?
- How set featured posts using checkbox in post edit screen?
- Post/Page Preview Template
- WP_Query: Why is sticky post not first item in loop?
- using wp_update_post on save_post
- WordPress plugin to publish to multiple remote WordPress blogs
- how to display full post with pagination on home page
- How to wrap every image in a post with a div?
- This AJAX Code Doesn’t Work – Looking for elegant solution
- Show One Category on Post
- WordPress Delete hook with wp_delete_post function?
- How to use alternate post layout at key points in post loop?
- Order post by year DESC and month ASC
- Showing random content / pictures from earlier posts in a sticky post?
- Do I use custom post type or something else?
- Delete Post From Front-End and attachment permanently
- Custom post type permalinks breaking due to 3.1 bug fix
- ‘Invalid post type’ error when importing from one site to another
- Double count view in archive.php
- Blogroll – Different layout for first post
- How to delete old posts’ edits to save space?
- Different style for most recent article
- Differentiate between posts and pages in search results
- Loop through all product posts?
- Display post category in foreach loop with category link
- Displaying Latest Posts on a Page
- Display all posts that were published before full post on single.php
- How to make number of blog posts a custom field?
- WordPress blog or WordPress website
- List custom taxonomy specific to one custom post type
- Hiding Draft Post In Admin
- Two loops, one AJAX loop, exclude posts in first loop from second loop, loops are in different files
- Making a custom Pagination for multi page blog post
- List authors with the last post title and order by last post date
- Thumbnail & Category link aside post
- “Right Way” to make custom Loop respect reading settings inside admin panel?
- Only display sticky post or latest post in custom loop
- How to make a sum of all posts displayed in a loop
- why does wordpress ignore the post args?
- First x post with another template then the others
- Loop doesn’t show title of second post and posts thereafter
- Grid post page on WordPress with Bootstrap, the_excerpt(); Problem
- Loop parent terms {display posts} AND loop child terms {display posts}
- add bootstrap post slider with tabs
- How to add add more properties to WP_Post object in search results loop
- Is there a way to create a meta box that can be added multiple times to a post dynamically?
- WordPress custom post type with folder structure in slug
- Add Blog to WP homepage Manually
- How to show all posts by author on buddypress profile with navigation
- Show custom post with custom categories with specific slug
- How to call posts under a specific category on static front page?
- separate the post of a category by subcategory
- Add post tags to previously created custom post type
- How to display only one category in a custom post type?
- Limiting the amount of posts retrieved by the loop
- Error while excluding a post from another loop (using its ID)
- Turn off display for custom sidebar post widget when on the post it’s displaying
- How to bulk Update URLs to new values?
- Include Recent Post in Category
- Pagination Not Working With Custom Post Type Category
- Diffrent layout for posts [duplicate]
- Hide or remove custom post status
- show loop id post , only first id can read
- Show custom post category for single post
- How can change header text in post careate/edit form
- How to get meta data from custom category name
- Wp_query loop is not working as it should
- Maximum number of posts per page before affecting performance?
- Display post order ranking within wordpress loop
- Difference between modified post and new post
- Problem with wp_insert_post()
- How to control Post view count incresing in sidebar widget posts too?
- Creating widget – ask for selecting a post in the admin panel
- wp query custom orderby not custom field
- Customizing individual images on posts
- Multiple Post Repeat for Related Post Loop by Category
- How to modify specific parts of a post content in WordPress
- Include post on external custom site
- Run Jquery Script after delete post in front end
- Where should get_post_meta() go to get $post->ID get_post_meta() is empty and $post->ID & get_the_id() are working
- Loop through posts by each term and exclude duplicate posts assigned to several terms
- Successive creation of over 1000 posts causes 404?
- How can I allow users (subscribers) to download selected posts into a single PDF? (RESOLVED)
- Only show posts with image and the correct ammount of posts in loop
- Related posts by searching post tags of single post as terms
- Redirecting posts in WordPress to a specific page
- How remove “recent comments” title without modifying code? [closed]
- When and how will php code in a user made WordPress page be executed?
- Dynamic Menu Item
- I have a website issue I am trying to resolve