I don’t know if there is a hook for the comment widget but you can call a widget in your template with a conditional to check if there are comments. You can probably also do this via functions.php.
Something like:
$num_comments = get_comments_number();
if ( $num_comments > 0 ) {
the_widget( 'WP_Widget_Recent_Comments' );
} else {
// do something else
}
Related Posts:
- Switching themes without losing widgets?
- can require “themefolder/includes/widgets.php” in “themefolder/functions.php” yet widgets.php doesn’t run
- Moving WordPress.com theme and widget settings to self-hosted site?
- Why are my widgets not saving when being added to a sidebar?
- How do I put my comment form above the comments?
- Duplicate and change a Theme Widget
- Current theme broken – after server and domain migration
- Changing $before_widget for certain widgets
- adding multiple sidebars on pages
- Embedded Videos (PB) – Not Available
- Widgets menu does not appear under “Appearance” in dashboard
- Calling widget via function in themes files (hard code)
- Inject widgets from one sidebar into another with PHP
- How to conditionally display widgetized areas in theme customizer?
- Add more widget areas to a theme
- Displaying a widget in sidebar only when no other widgets rendered?
- Style the archives/category sidebar widget via theme
- Restrict access to specific widget field based on user role
- display comment form for specific post id
- Problems to disable the comments for my statics pages
- WordPress TwentyTen Theme Incompatible with Theme Unit Test
- Modifying the markup in the Tag Cloud widget?
- How to override / customize existing Widgets?
- Remove Commenting on Certain Pages
- Widgets not showing on sidebars
- linking to an svg through comments_popup_link
- Using filter in the widget causes fatal error
- Does Jetpack store comments in local database also? [closed]
- Comments not displaying after changing theme
- disable default widgets in Responsive theme
- What happened to my Inactive Widgets?
- Unable to thread comments because of custom comments.php file
- In a specific blog, the K2 theme does not have a Text Widget
- How to edit the default comment title?
- Removing a widget via theme editor
- sidebar in 2020 theme as a widget
- How to customize a section of a widget only on certain pages or page
- Changing theme folder name disrupts widgets
- Lost for direction on how to continue building a theme
- Theme comment callback results nothing
- No “available widgets” (wordpress 3.2.1 multisite)
- how to add version of style.css in wordpress
- register_sidebar ignores ‘id’ and ‘class’
- Is it possible to stop a theme activation when a certain plugin is not activated
- add image size still doesn’t work even after regenerating thumbnails
- Best location for theme translation files
- How can I customize the search results in Bones theme?
- How to develop a theme while having another show up
- When does WordPress wrap inline scripts in CDATA?
- Switch to other theme at URL
- How to go about pre generating css file with variables from theme options
- How to load a different theme for categories?
- How to change sidebar per page?
- Add a series of checkboxes to theme options
- WordPress Theme Development Seemingly Awful Partitioning of Includes?
- What is the major difference between child theme and normal theme
- variables in translatable text
- Understanding Theme specific Code
- I get the following message The uploaded file could not be moved to /home/reascom/public_html/wp-content/uploads/2012/07 [closed]
- Custom CSS doesn’t work in edit mode
- Twenty fifteen theme – change responsive menu condition
- Getting 503 on various files
- Port existing Bootstrap site to WordPress?
- GPL and intellectual or exclusive ownership
- Updating / Transferring site
- WordPress root directory change + Theme directory change
- What Generated Classes and IDs That Is Always Used On All Themes?
- Adding Sidebars in WordPress Theme
- simplified explanation on child themes?
- Calling external Libraries in WordPress
- Using the same database on another Subdomain
- How to add more default colors?
- Theme folder doesnt exist
- Increase content area width in TwentyFourteen [closed]
- Undefined variable error in theme option after updating theme [closed]
- Theme Translation?
- List of categories instead of dropdown menu selector in admin options
- Query for all themes?
- How can I show some standard html code across any theme I install?
- Losing theme customization when switching from a theme to a child
- Problem of not changing the front and bottom of the Woodmart template by activating the really simple ssl pro plugin in WordPress
- Please help me clear my confusions about WordPress
- Commenting requires wordpress login, wordpress discussion and post comments tick boxes are checked
- Dynamic image for Jumbotron on WordPress Custom Theme
- How to implement theme option to change bootstrap 4 container from .container to .container-fluid
- How to narrow the area between buttons on Helium theme sidebar? [closed]
- use a Thumbnail size in post
- Why does WordPress Editor Only Use Half the Box?
- 500 Internal Errors
- Installing Theme from uploaded file. Not uploaded theme?
- Strange Theme Error – parent style occasionally showing though child theme
- WordPress theme not updating in Other browsers
- Can i add wordpress editor to my custom theme option? [closed]
- Template from scratch: Sidebars not showing widget
- WordPress – show number of comments for each post in widget
- Where do URI files come from?
- Converting HTML5 to XHTML
- Best way to include pagination in a theme [closed]
- How to change the standard width of a page
- Fatal error Class-wp-hook, again, but not sure what’s triggering it