get_terms()
retrieves terms in general, it makes no connection to a current post in loop.
What you need is one of template tags, which retrieve terms for the post. For example the_terms()
:
while (have_posts()) : the_post();
the_terms( get_the_ID(), 'event_cat' );
endwhile;
There are quite a few functions dealing with terms, depending on what you want to do with data.
Related Posts:
- have_posts() return false but count says “3”
- Get posts that matches specific terms of multiple custom taxonomies
- Using get_term() in functions.php results in Invalid taxonomy error
- Adding active/current class to get_terms list
- Displaying terms based on loop posts?
- For each loop on every word in post
- Avoid WP_Query’s duplicate posts with taxonomies
- How to add pagination in Terms
- Exclude posts from loop by term
- Modify my code – which takes the first sentence of the post and use it as a h2 tag – to work outside the loop
- Redirect loop when trying to login to /wp-admin/ [duplicate]
- How can I custom order the results from wp_list_categories?
- Display all authors and their only one latest post
- Remove comma from last item output from loop
- as a shortcode within the loop?
- Page template not displaying
- How to show just private posts in loop
- How to paginate this custom loop? [duplicate]
- Can I use both a custom excerpt and a trimmed excerpt?
- Select data from database and list it in Loop (WordPress)
- How to get_template_part using AJAX?
- How can I modify the loop from a plugin without wiping out other filters?
- I’ve been out of the loop since 2.8. What did I miss?
- Loop first six posts in carousel, next eight in grid
- Infinite blog loop
- One custom loop with condition to check child posts
- Loop get_theme_mod
- Move sticky posts down in main loop
- Why only one post (and no pagination) on this variation of the loop?
- Loop in Related Posts WordPress
- Conditional query that displays on Woo product attribute pages
- Template structure
- The Loop – mixed ASC and DESC order
- Filter the_posts doesn’t work on search page
- Custom Loop Using Shortcode in Custom Page Template
- Listing subpages title and content and styling the first iteration differently
- single.php – how to mark current page in the loop
- Cannot retieve the_content() and the_author() – both returning empty strings
- How to order by multiple fields using standard query_posts?
- How to get the excerpt for is_home() outside of the loop isn’t working
- Make loop alphabetical
- How to check if a product is purchased within the last 365 days before displaying something
- How do I get my loop.php to properly paginate?
- Custom loop ordering not working
- First archive page with a few posts
- Loop through ACF taxonomies and output associated posts
- How to get user ID’s from multiple usernames?
- How to display first post
- Pagination on custom post type on front-page.php
- get_template_part() Not Working in Loop
- Query posts only with actual text content (not including shortcode or images)
- CPT while loop not working
- Problem with Front-Page.php loading recent posts
- Comments_template doesn’t work
- Get markup for post without loading into the template
- How to use this $tax_selection variable in this custom loop?
- Display all categories as plain text
- Query post & loop problem.
- Exclude current post ID from loop in sidepbar.php
- loop inside a loop : search for posts in the same category
- How do i create a loop that list and divide posts into months?
- Forcing page to top of the list when using get_pages
- How to declare a variable in a loop and make it available in the template file
- How to display fields from the loop in two separate divs
- How to use single.php output in function.php
- Duplicate posts on archive page
- Pagination on a underscore custom theme
- Build a Page which shows the Oldest Post with specific Custom Field Value
- WordPress multiple loops with default pagination
- Loop random posts and display odd and even based on two alternating meta values?
- WordPress + Isotope: how to give different widths to each entry?
- hide woocommerce tab if empty
- How to manually define the primary loop
- Url outside the loop
- How to filter get previous post function by meta value DESC and post date DESC?
- Output slugs to use as class names for every taxonomy a post is attached to
- Style first 3 posts differently and use a 2nd loop to get rest of posts / offset and pagination broken
- Posts Per Page is Not Returning Correct Number
- Cant pull in featured Image
- Link Button url count php and wordpress
- Set loop format & have a loop inside other one
- Need a conditional to test if title of parent page matches title of child page
- Query counting excluded category on paged loop
- Using shortcode within shortcode with dynamic variable
- modify default HAVE_POSTS() Loop without inserting new variable (i.e. $loop->HAVE_POSTS)
- Display articles related to a custom field on a page
- Why is my pagination showing up?
- stuck with template hierarchy
- How to create an identical second loop for attachments?
- Randomly Display One Image From a 10-Image For Loop
- An action that runs after each post in the loop on index/archive page?
- Getting post id in for loop
- pull 500 post of many from database [duplicate]
- WordPress loop put title into variable
- How do I display 3 post each in a bootstrap carousel?
- Multiple loops using next_posts_link & previous_posts_link
- wp_mail sending only once inside foreach loop
- How to use orderby on meta_value when using Pods custom database table storage
- wp_mail function not working in user query loop
- How to set and retrieve cookies while in the loop