You want to use get_comments_number()
as that doesn’t echo the results, while comments_number
does echo
Related Posts:
- Why use if function_exists?
- What’s the difference between esc_html, esc_attr, esc_html_e, and so on?
- Include files in child theme functions file
- Check if post is being published for the first time, or is an already published post being updated
- Is it possible to rename a post format?
- How to get woocommerce inventory status [closed]
- Is there a hook or function I can use to display all theme files being used on a current page?
- Implementing DNS Prefetching with WordPress
- How can I remove the title “leave a reply” in the comment box in twentyeleven?
- Child theme – overriding add_image_size by a child theme [duplicate]
- Why do I get Fatal error: Call to undefined function get_most_recent_post_of_user()?
- Check if has any sidebar active on current page
- Login using the password from protected pages
- Remove tag on my RSS Feed
- Automated mark posts as featured every day
- Enqueuing External Javascript functions.php
- Child Theme Not Overriding Parent Theme
- Function to wrap the_content in a div
- How to run a function once on every post in database?
- Checked() showing up twice in custom fields
- Date/time limitation of posts where function must be executed
- Custom image size in Media Dropdown
- Trouble using antispambot()
- Gravity Forms field entries into wp_query loop [closed]
- Post Pagination Showing Same Posts Every Page
- Update Content based on expiration time or queued processing
- How to filter a table in post content without plugins? [closed]
- Adding to fontawesome-webfont.woff2 to boost website speed
- How to enable template page only for a post id page
- Having issues with a foreach inside of a shortcode with ACF gallery
- Don’t delete a page if it holds users
- Remove after images
- Is there an alternative to get_template_directory_uri()?
- Word Press – Dynamic Content [closed]
- Change label for registration Fields
- Warning: : DOMDocument::loadHTML(): Empty string supplied as input in functions.php when adding classes to post images
- Remove stylesheets from Campaign Monitor plugin
- Get First Child Page ID or Permalink in WordPress Admin
- Footer disappears when using the_content ( )
- Get page id or status by private pages?
- Categories as main menu items and subcategories as nested lists
- woocommerce change currency per category [closed]
- I can’t enqueue my scripts – They literally aren’t being added to my site
- Using wp_redirect and .htaccess to re-route searches (and pass along the remaining GET vars)
- Multisite 404 on pages – rewrite error breaks database
- Custom Sidebar only on single post
- Trying to register script in footer
- register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget() instead
- Do I need to use wp_reset_postdata for my function?
- Can I have an additional functions.php file in WordPress?
- Shotcode argument issues
- Split Media Queries in different files!
- functions.php and conditional tags
- how to make has_block() see inside blocks too
- add_theme_support( ‘title_tag’ ) is not showing title on index.php
- Tracking the number of shortcodes for a list?
- Need help with customalert that it would read on a normal page, but not in WordPress
- Child theme function.php causes fatal error
- Best way to disable sidebars on posts (only)?
- How to print the current post depth as update notification?
- How to safely edit functions.php
- Linking Javascript in functions.php file
- Enqueueing scripts selectively & activation where needed
- Changing the text of Upload/Insert on Posts and Pages Screen
- Using One Function To Create Two Different Shortcodes
- remove edit link only for published post and pending post
- Change Page Title
- How to Not Show posts on Category page?
- Put images in the media from url functions
- Paragraph spaces in email template function
- Is it possible to load recaptcha script only in url with fragment identifier (#)?
- When are the user meta fields created in the database? Admin vs Woo API REST
- Including Font Awesome in a Custom Theme
- How to automatically add counted number to navigation menu items?
- Insert Modal on user first login
- Trying to load JavaScript only on pages within a PODS category/ custom post type
- How would I correctly implement a new if statement in a child functions file?
- Correct way of Enqueue self hosted fonts in sass project
- function syntax is off,
- How To Show Shortcodes In WordPress Custom Fields?
- Language Switch Function
- How to debug function file causing white screen
- Change category checkbox into radio button [duplicate]
- Author info does not show up when author has no posts
- How to add next height number in Order Attributes inside the Add new page. [duplicate]
- Load CSS conditional on custom field is present
- Modify sub_menu function to show pages below a specifically set page
- Add custom class to all URLs on entire site
- Show the online status of the current post’s author
- Functions.php in child theme that loads CSS file breaks website
- Unregistering custom tinymce plugin?
- How does child theme functions.php work with parent theme functions.php? Is it like CSS? [duplicate]
- restrict access to specific urls on a specific period of time
- Change conditional tag in wordpress without editing the core files
- Need a functions that adds (adm)/(mod) if current user is admin/moderator right after their username
- site_url is not honoring scheme
- clickable title of 2 post on mainpage USING functions.php
- Custom Post Type Search
- Setcookie not setting cookies anywhere except admin
- WooCommerce, change “Add to Cart” to “Link to Product”, only for specific categories