Resolved this by using get_the_tags($post->id);
instead of wp_get_object_terms( $post->ID, 'post_tag' );
.
get_the_tags($post->id);
hooks onto the WP_Query within the loop and retrieves the tags without the need of additional SQL queries.
Related Posts:
- Exclude most recent posts from specific category in wp_query()
- Custom WP_Query for current category (in category.php)?
- Unable to get all tags from specific categories
- Display related posts with same category or same tag return blank
- Is There a Difference Between Taxonomies and Categories?
- What is the difference between a “tag” and a “category”?
- Can’t custom taxonomies have same terms (slugs) as categories?
- Get all categories and posts in those categories
- How to display non-hierarchical taxonomy as terms with checkboxes?
- How do the ‘tag’ and ‘category’ (default) taxonomies do ‘save_post’ action?
- Control term order on a per-post basis
- get all tags from category
- 404 Error On Category and Tags Pages
- Combine two taxonomies in a hierarchical tree
- Checklist of selected categories
- How to get posts from two categories with WP_Query?
- Group WP_Query by category
- Exclude categories from search query
- Rewrite URL with category and tag combined using WP_Rewrite
- How to tax query X number of posts related by tag first, then by category if not enough in tag-related
- Use tag interface for hierarchical taxonomy?
- How can I reduce the number of database query calls for this custom homepage?
- WP_Query not looking at child category
- Sort posts by tags in category pages
- How to search for categories and/or tags?
- Using URL parameters, list posts from category and custom taxonomy
- Get page content by category or tag
- How to get the url to tag & category base set by the user?
- Filter categories using tags
- Sticky posts on home page, search, tag and archives without plugin
- Are Categories, Tags and Custom Taxonomies any different in regards to SEO?
- Category and tag with same name
- Create subdomains for tags and categories
- In the tag archive – display count of posts for each category they belong to
- Is it possible to disable certain user roles from creating tags?
- Automated adding of one tag to all the posts in a category
- Excluding posts from a category but only if they’re not in multiple categories
- What could be causing my wp_query pagination to break?
- Custom query with category exclusion and post-meta “whitelist”
- Moving Categories submenu to Media, but still opens Posts menu
- When using get_categories or similar, is it possible to filter results that contain certain Tags as well?
- How to totally get rid of Category in my blog?
- Root level category, tag, author and archive pages to work
- Showing all the posts in one page?
- Categories and Tags returning 404 on the sidebar when using ugly permalinks
- Display one latest post from multiple categories
- How to Check if a Child Category is Being Queried
- Deleting All tags except categories Wp database
- Is it possible to put tags and category information in the post as text?
- Script to duplicate categories as tags
- Search by word, category, tag, author
- Remove Categories and Tags from Admin Dashboard
- How to filter archives both by category and tag?
- Remove Archive Headline and Archive Intro Text fields on category and tag archive pages in WordPress Admin with Genesis framework
- display most popular tags of category?
- Get tags specific category
- How to run WP_Query to retrieve attachments to posts only from a particular category?
- Can paginate_links() be customized for a specific category or tag?
- How to query posts from specific authors and categories using WP_query?
- Any way to assign Post Categories and Tags to Links?
- Category archive page – loop through posts of certain tag (with pagination) – pre_get_posts
- How to show in search results posts with a particular tag in a particular category?
- Category vs Tag vs Table
- Help with multiple dropdown tags search
- Hide tag and category boxes from the post editor
- Retrieve all posts within tag OR category?
- How to find the number of Tags a post has?
- How to not treat categories as tags in feeds
- Categories: A Greenhorn Question on Strategy (Not Code)
- How to customize tag and category post listings to show introductory content?
- List Posts by Category for a Non-Zero, Non-NULL Custom Field Value?
- getting content from main domain to sub-domain using category and WP_Query
- WP_Query() returns null when results exist!
- Are Category or Tag Archive Pages Possible?
- Ignoring a category in WP_Query still shows the links in next_post_link()?
- 3 Columns, 3 Categories, One Archive, and Pagination
- Warning: sizeof (): Parameter must be an array or an object that implements Countable, On products pages
- How can I duplicate categories and tags?
- How to run select query of post with category and tags for API?
- Making a tourism information website [closed]
- Random post + categories + tags
- Search Posts / Pages with multiple options?
- How get permalink for the current category or tag?
- Display tags from specific category in select fields
- Offline WordPress Application
- Changing permalink from /postname/ to category/postname/
- Enter a variable in the ‘category_name’ parameter
- Find out which user created a category or tag?
- RSS/XML of all Categories and/or Tags
- How to query post like normal search would do. within search.php page
- Get Tags specific to Category using WooCommerce plugin
- How to make 2 tag feeds show up on 1 page?
- Cluster WooCommerce products in each Category Archive by Tags assigned to products
- Different templates for different category tags
- Site search needs to find posts for category topic AND Tag or keyword thats not in the post
- Pagination is not working properly in Product Category/Tag pages
- Get link which associated with a specific category and tag
- Query posts intersecting tags and categories
- How to get related tags based on a category?
- Needing a snippet for listing category specific tags