Comments aren’t in the “footer”, they are in the Loop, and they need to be to keep their association with the parent post. That is why you are having trouble. You are moving them out of the context that Core expects. What you are going to have to do, I think (and I haven’t tested this), is explicitly pass the post ID to the relevant functions– comments_open()
and is_single()
.
if ( comments_open($post->ID) && ! is_single($post->ID) ) :
Related Posts:
- What is the best way to include a widget in a Page?
- How to hack recent comments default widget?
- Display attachment, post and page in recent comments widget
- How to stop comments widget conflicting with theme comments
- Recent Comments from Specific Category Widget
- recent comments filter by author, page, category
- Need two sidebar (right and left)in Twenty Seven theme
- How to get widget content in WordPress based on it’s ID?
- Full Width Container Colour Problems
- Limit number of Widgets in Sidebars
- How to load Widget javascript + css files only if used?
- check if registered sidebar is active & has widget content
- Adding iframe Content to Sidebar Widget
- How to use wp_dequeue_style() for style enqueued in WP_Widget class
- Storing custom dashboard widget options in wordpress
- Programmatically edit the text of a widget
- How can I whitelist only specific shortcodes for processing in text widgets?
- Create a Widget Area in the Navigation Bar for the Genesis Theme Framework?
- Manual display of widget
- Customized widget area – how to override or filter class xoxo?
- How to access widget data from outside widget?
- How to add a description to Widgets?
- the_widget() and widget’s ID
- How to put Stack Exchange Flair as widget?
- How do i display the built-in gallery inside a widget?
- Forcing the title of a text widget on to a new line in the admin area
- Image Upload Widget Issue
- Wp Customizer event for when a new widget has been added
- Sidebar not show customizer!
- Customizing wordpress default widgets?
- different class (css) for sidebar widgets
- Adding widgets with Featured Image via the Customizer run hundreds of queries
- How to make this change without changing the core? [duplicate]
- Add pagination to listing plugin
- how to put functions inside of widgets
- Adding a Widget : what to put in plugin URL
- How to list all custom post types in a custom widget?
- How to extend WP_Widget_Media
- Drafts widget for admin page
- Global $wpdb is not showing correct data with function call
- Dynamic created widget id value of multi-instance in jQuery
- Post ID displayed instead of title [closed]
- Color picker in widget appears twice when added via the Customizer
- Hide widget (and white space) on specific resolution [closed]
- Adding Widgets to Draft Pages
- How to select multiple media files for a widget form?
- How do I pass the id of my widget to javascript in the form function?
- Widget – link to page rather than absolute url
- Programmatically add widgets to sidebars
- Are widgets meant to be used outside of sidebars?
- Is there a WordPress widget for my webpage?
- Validating widget’s configuration data on Admin page
- FTP Widget Location
- Inserting Read More Tag in Widget
- dynamic sidebar in front page
- Display posts from category in post content?
- display widget checkbox selection on frontend
- Enabled checkbox by default in WordPress widgets
- Widgets in WP 4.3 disappearing – How to fix?
- Making jQuery .change() event persistent after widget save
- Widget background images missing on second blog excerpt page
- How should I add a “widget” like element?
- All Posts Have The Same Comments
- modifying title (in dashboard) for different widget instances
- How to translate Widget Description in constructor?
- What conditional to use for dynamic sidebar check?
- How to test if the widgetized area has any widgets?
- Saving widget gets an undefined variable
- Trouble accessing a multidimensional array to add classes to default WordPress widgets
- Distinguish between different widgets of the same type
- links to Media Library content in sidebar per page
- Why is registering a sidebar for each page causing my sidebars to reset?
- How do I customize the positioning of WordPress widgets?
- widgets in footer?
- Quick Draft widget in weird place on dashboard after being re-added
- How can I remove WordPress element IDs and Class names in the HTML?
- Remove widgets on mobile front page without affecting desktop
- Widget display nothing
- How can I have sidebar widgets on Twenty Seventeen theme on all pages?
- Collapsible widgets [closed]
- Loop through Widgets in sidebar using widget array number?
- How to display author meta in a sidebar widget
- Is it ok not to set widget in the main page of a one page WordPress Theme?
- Recent Posts Widget URL / Domain change
- New Custom Widget Call a Different Widget Function
- Loading scripts only if a particular shortcode or widget is present
- include exception inside theme for empty widget area
- Always show the widget title in a wordpress widget
- Custom php Widget keeps disappearing from the front end
- Insert to wp_footer if widget is found in the sidebar
- Using javascript on the new widget preview / customizer page
- Conditionally enable autoplay when using oEmbed in a custom widget
- Custom tabs widget don’t work in google chrome, is blocked, do not change the tabs. Why?
- WordPress Hide Widget If $_Session Is Active?
- Widget which displays thumbnails, but links to urls?
- Recent posts with different class name for each post and a scrollbar?
- wordpress pinboard theme [closed]
- Classic widgets with 5.9+?
- Can’t edit the widgets sidebar or footer
- Custom dashboard widget – load style only for added widget