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?
- How do the ‘tag’ and ‘category’ (default) taxonomies do ‘save_post’ action?
- get all tags from category
- 404 Error On Category and Tags Pages
- Checklist of selected categories
- How to get posts from two categories with WP_Query?
- Exclude categories from search query
- Sort posts by tags in category pages
- How to search for categories and/or tags?
- 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
- Category and tag with same name
- 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?
- Custom query with category exclusion and post-meta “whitelist”
- Root level category, tag, author and archive pages to work
- Display one latest post from multiple categories
- Remove Categories and Tags from Admin Dashboard
- Remove Archive Headline and Archive Intro Text fields on category and tag archive pages in WordPress Admin with Genesis framework
- Get tags specific category
- How to query posts from specific authors and categories using WP_query?
- 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?
- Warning: sizeof (): Parameter must be an array or an object that implements Countable, On products pages
- Making a tourism information website [closed]
- 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/
- How to make 2 tag feeds show up on 1 page?
- 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
- Combining categories (Query posts with multiple taxonomy terms)
- Is there a reason I cannot get the current category in a loop?
- Display posts from a category
- How to Remove a Title from All Category and Tags Page?
- category__not_in and id values from variable
- How can I display tags as categories?
- How to get an array with all categories and corresponding names?
- Echo text using is_tag
- More efficient way to list posts by category [duplicate]
- Query posts by views on category page
- Use blog as base for tags and categories
- Show multiple categories in query using redux framework variable
- Are term_taxonomy_id and term_id the same? [duplicate]
- Using in ‘category_name’ in ‘$query->set();’?
- Custom Page Template Category loop not functioning correctly
- How to store category and tags separatly on wordpress?
- Filter categories/tags to display in multiple metaboxes for selection in back-end
- post_class remove tag- or category- from slug
- How can I use AJAX with check-box categories?
- Editing Loop So It Targets Specific Tags?
- Pretty URLs with Categories and Tags
- Select posts that match multiple category names, must match all categories listed
- Autolinking keywords in text with tags
- How to display the 5 latest post titles but allow only 1 in there of a specific category
- Maintaining a separate posts page for certain categories and don’t show those on home page
- Are tags different than categories?
- What is the best way to add an advanced / intermediate / beginner tag to a post
- Display all categories but only if they have posts in them that have a specific tag assigned
- Help to display the current categories and tags of a post
- How to add tags under categories
- Add Post Categories in Post Tags Field Programmatically
- How to show entries related to main category
- Automatically create tags and merge with categories
- How to assign Categories and tags inside the TinyMCE Editor for each Image?
- Re-coding category-template.php to go to custom URL
- Search by tag, category and author without plugin
- Limit Category/Tag Dropdown To blog_id in Multisite Install With Global Categories/Tags
- Tag Menu items based on their categories
- How to add an “All” category to the tag cloud?
- Hide category name using mod_rewrite
- $args Orderby The number
- Querying Multiple Categories With Different Offsets
- htaccess redirect for all categories converted to tags now showing 404
- Custom Category Page Not Working [duplicate]
- altering theme – content generated by PAGES not PORTFOLIO
- Search tag within category
- WP_query exclude a category unless it has more than one catagory
- Show only one category in main query, issues on tag page
- How do i add custom post types to this query?
- Narrow Down a Shop Page Results Based on a Product Tag in WooCommerce
- Trying to WP_Query a category