Switching out echo get_comments_number($post->ID)
for echo $post->comment_count
did the trick.
I have no idea why, that’s exactly what the get_comments_number()
function does…
Related Posts:
- Order by DESC, ASC in custom WP_Query
- Exclude or Include category ids in WP_Query
- Changing the meta_query of the main query based on custom query_vars and using pre_get_posts
- Query Posts in a Predefined Order
- WP_Query based on URL parameters
- Order by meta_value_num DESC and meta_value ASC on WP 4.0
- How to query for a week using key => value WP_Query argument notation?
- How to use filter hook posts_join for querying taxonomy terms in posts_where?
- How can I style future post?
- List taxonomy terms plus their latest post ordered by post date
- WordPress altering my custom query, How to fix it?
- Looping through tabular data
- Using next/previous_posts_link with customised search
- How to create/modfiy WP_Query to search in post title OR custom field?
- How to detect custom query inside `posts_where` hook?
- Is temporarily overwriting $wp_query a bad idea?
- Array Chunks and Inserting Varying HTML in WP_Query
- Modifying the Search Results
- WP_Query times out
- Offset Page Loops and Pagination
- How to find a post id using the post_excerpt?
- wp_query add arguments using array_push if variable met
- Comparing dates in custom field
- reducing the amount of wp_query calls
- WP_Query filter and order by meta ordering by wrong joined table
- Querying A Post That Includes Two Taxonomies Using JSON Rest API
- WP_Query condition affects posts_per_page count
- Use post object from first query in second query
- Order by title without taking into account ‘the’
- Set global $wp_query/$post variable for dynamic page generation
- Adding column to wp_posts table or join wp_posts table with another table
- slow WP_Query for non-admin user
- meta_value_num not ordering all items
- Meta Queries – should nesting work after WP 4.1?
- WP_Query Attachment adds additional attachment count and need to link attachment to post url
- Is there a better way to pull in custom content without querying posts?
- WordPress | Date not always appear [duplicate]
- WordPress posts for multiple years
- Pass $page_id to new WP_Query
- Can I modify a WP_Query instance or clone it with modifications?
- Include posts from some categories while excluding from others
- Filter posts by comparing custom meta value against postdate
- Show a 404 error page if Public query variable’s value doesn’t exist?
- WP_Query within function within WP_Query
- Multiple Rows in a using wp_query
- “paged” in WP_Query returns 0 posts
- Count posts per taxonomy else change taxonomy if less than x number
- Daily drip of posts – based on user ‘startData’ – ordered oldest to newest
- How to add tax_query to $args with concatenation
- Change AJAX filter from POST to GET for URL Parameters
- Running multiple WP_Query
- Where is the extra SQL fields coming from?
- How to split a post and intercalate elements from a loop
- Create one-use post dynamically, add to main query, do not insert post (user profile view)
- How to create a widget like this?
- How can I update post meta inside a WP_Query loop or the WordPress loop?
- Printing a variable inside a custom WP_Query
- Creating attachments archive in tags and categories
- Does query_posts have an effect on get_the_category?
- Second loop pagination changes URL, not content
- Help with Wp Query
- tax_query in pre_get_posts
- adding pagination to a foreach loop in wordpress
- How to prevent WP_Query from filtering on ‘s’ but keep ‘s’ for other purposes?
- Query on meta values and post title
- Add dynamic search to paginated WP_Query
- Adding GROUP BY in Custom Query not working with ORDER BY
- Access queried post ID in WP_Query
- Where is the coding error for the unexpected ‘}’ in this if / else choice of loops?
- Show custom content when loop or wp query reaches specific time?
- Query Order By Number Variable From API
- Wp includes access control
- Sorting query_posts() with a complex orderby filter
- Order posts by title and custom field value?
- How to show post title in content editor in backend?
- How do I hide submenus from the top menu bar?
- How to exclude posts by ID within a category/archive loop
- Dynamically Update Page Content
- Optimal way to make tags in tax_query optional?
- How to count posts in loop with infinite scroll?
- List users by Year of Birth using a foreach loop to dynamically populate years and data
- What is the best way to reset a search on a meta_key / meta_value?
- Exclude all tagged posts from WP_Query loop
- Bring a post to the top of the query if it’s in a certain category?
- WP Meta Query at depth 2
- WP_query for posts with same post type AND same post category
- Using WP_Query to re-query and sort results using a date?
- Geo location query inside wp_query?
- Custom query with ‘tax_query’ and ‘meta_key’ returning no results
- WP_Query is being reset after tag (using chaining method)
- Pagination is not working on custom query inside a custom home page template
- Get the type of an advanced custom field (ACF) in a WP_Query loop [closed]
- Getting Year & Date inside wpdb [duplicate]
- loop through custom post types with meta data
- Looking for a way to exclude frontpage and nav menu from query filter
- Using Query In Post Type Archives
- WP Query Obj: Set value to be unequal | Hide media by admin
- Get posts by meta value except one post [closed]
- Display post format post in the sidebar
- Is there another way to retrieve a post_id from post_meta other than a SQL query?