I think you should use the wp_reset_postdata();
function after the widget area.
Probable reason for this behavior is the widget, which itself uses two wp_query();
functions. May be those quires modifying the global $post
data which is actually used by your main query.
I guess calling wp_reset_postdata();
function right after the widget will solve the problem.
Reference – Codex wp_reset_postdata()
After looping through a separate query, this function restores the $post global to the current post in the main query.
Related Posts:
- How to have more post in a page than in your home page
- Keep featured content post in homepage with original order
- How to get post ID of the current page/post inside a widget?
- Template file for static posts page does not get loaded?
- How can I display 7 posts on the home page, but 9 posts on the subsequent pages?
- widget should display post archive by year and on click also by month
- how to display full post with pagination on home page
- How can I specify a category post on my home page
- Which file displays the date archive?
- Hide parts of the post content on the home page
- Show post titles only on the homepage
- Displaying Page Title on index.php
- Get all posts by post_author
- Linking to page with all posts
- How to link up “read more” on excerpts hack from WP Recipies
- Can I set and show “important” post in my blog?
- Displaying a widget only on long posts (over X characters)
- How can I display widget in a Page or Post?
- How can I remove posts of a certain category from homepage after a specified time period?
- How to make the post summary taller?
- Static page does not show my posts
- Limit posts per author role (excluding admin) in home page
- Properly display posts on homepage
- Best way to assign post position in a news site homepage? (no categories, no sticky posts)
- Ajax load more button in Recent posts widget
- I want to display custom text widgets for each post in the sidebar?
- How to show last post of each website of a MU wordpress in HomePage
- Move first half of posts to one parent page, second half to the other page
- How do I display some posts fully on the homepage, and some as an excerpt only?
- Editing the default page to show all posts, rather than most recent ones
- remove post and categories/tags count from right now dashboard widget
- Hide posts belongs to few categories in homepage
- What file is the standard frontpage that lists all the posts?
- How to Use index.php file for “Blog” Page And this is Not a Home Page
- Loop doesn’t exclude the specified category in home page
- Widget that shows categories with posts numbers
- Single Post in Tab/Slider
- Display current post position in Elementor Posts widget
- Custom posts listing widget always returns 1 extra result
- Add hero image to home page (blog format) via the dashboard
- Custom home page with full post for first one only
- Need to know custom code to display random and most viewed posts in wordpress posts and pages
- Load widget only on blog posts
- Inserting an example of the last 3 post on to the homepage
- I don’t want the complete article to show on homepage
- Post is in descendant category not working in home.php
- links to posts not working on homepage
- Widget to show posts in the sidebar basing on its IDs
- how many visitor open this post? [closed]
- What’s a theme that properly handles previews of different types of posts?
- Conditionally exclude post from specific category on home page sidebar?
- How to show multiple posts thumbnail, title and date in widget
- Move position in post list for a custom checkbox column
- Add checkbox in admin post list – show checked post in widget
- Create a List of Widgets, where each widget holds three attributes
- Custom Fields – How to get the list of a specific active widget each time it rendered
- “Blog pages show at most” in setting not working
- Why is WordPress showing a blank excerpt for just one of my posts?
- How to show only homepage in google results instead of privacy, contact pages
- How do i bring out post category name in my widget?
- Include Recent Post in Category
- How to Make my Homepage Display a Single Specific Post?
- Make current post the homepage
- post__in no longer works in wordpress 5.0.3
- Blog featured images disappeared on my homepage
- Blog images not showing on homepage
- Display post on main page with thumbnail
- Posts on Sidebar only
- How do I create a ‘selection’ criteria list’ that will then dictate which posts are generated when the user presses search?
- Creating widget – ask for selecting a post in the admin panel
- How to display most popular posts from certain category in sidebar?
- How to remove related post from home page
- Post as frontpage – avoid duplicate content
- Post List Widget with custom posts and editing the Read More Link
- Link post to blog from a static page
- Hide first blog post in content and output it in widget
- 404 error on every post and page other than home
- How to use in_category?
- Trying to display stick or featured post on homepage
- Home page: using custom fields for posts and pages
- How can to use the players from the Media Widgets in the body of a post to play audio and video files
- How to add a widget area between blog posts in Genesis Framework?
- wordpress pinboard theme [closed]
- Display content from specific category
- Output number of WordPress posts remaining until a post milestone is reached
- Image inside the content is replaced with featured image from my older post
- Change WordPress post-state in Admin Area
- Guest Author – How to modify my custom function code if the guest author URL will follow a particular pattern/format?
- Multiple authors for single post without plugin
- Is there plugin to show recent posts from one website in the widget area of another?
- Duplicate posts and change category
- Removing noindex posts from wp_query
- Set static page/post from another blog on same network
- Can’t save WordPress post with “/etc/” in it
- Trim posts from WP-Query?
- how can i take wordpress post as embed?
- WordPress Website is Auto-Posting strange posts
- Display post in visual composer with custom html
- How to get override the WP Admin Syndication feed limit for a custom feed?
- Custom post order returning posts from other categories