I’m answering the <?php //echo tax names here ?>:
-
In the loop, you can get the post terms using
wp_get_post_terms():while ($articles->have_posts() ): $articles->the_post(); $terms = wp_get_post_terms( get_the_ID(), 'topic', [ 'fields' => 'names' ] ); -
Then you can do something like
echo implode( ' ', $terms );inside the<div>tag:<div class="masonry__item col-lg-3 col-md-6" data-masonry-filter="<?php echo implode( ' ', $terms ); ?>">
But are you very sure you want to use the term name and not slug?
If you want the term slug, then you’d use 'fields' => 'id=>slug' and not 'fields' => 'names'.
Related Posts:
- $wp_query->queried_object->ID throws warning: Undefined property
- Select All in Parent Category, Group by Child Category?
- get_query_var() not working in pre_get_posts
- The Operator “NOT IN” Does Not Work In tax_query
- How to get_queried_object on multiple objects?
- Displaying Posts Related to Other Posts by a Taxonomy Term?
- Sorting a list of posts displayed under a list of associated terms (which should be sorted without initial articles)
- How to get the parent’s taxonomy?
- Querying Posts by Taxonomy From Alternate Network Site
- Help with hierarchical custom taxonomies and permalinks…almost there
- custom post type paging not working past page 3
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- Custom Taxonomy and tax_query Issue?
- Query for posts in 2 taxonomies
- Optimised Code for Pulling Taxonomy Posts
- Show Post Count of a Category
- WP_Query search posts by custom post type and custom taxonomy
- Custom Post Type Loop within Shortcode
- Fetch taxonomies by custom post type id array
- Display CPT posts based on specific taxonomy
- shortcode to show custom post types by category
- Query/list all terms and their custom post count
- Filtering WP_Query Dynamically on the Front-End
- Why get_posts() not returning only selected category posts from Custom Post Type?
- Genesis filterable portfolio isotope [closed]
- Get custom taxonomies from multiple posts
- Pagination for Custom Taxonomy Page [duplicate]
- Custom loop with multiple taxonomy queries
- Return one unique custom post type result when it shares a custom taxonomy in WP_QUERY?
- Custom taxonomy rewrite give pagination 404
- WP_Query inside foreach loop returning same value for all options when filtered using ajax
- How can I made custom taxonomies relationship?
- Custom taxonomies relationship
- How to have this permalink structure: post_type/postname/custom_inner_page
- First custom field value (out of several) displayed twice after query
- WP_Query orderby and tax_query
- Advanced search form with filters for custom taxonomies
- Why is my WP_Query outputting my entries twice?
- How to display Related Posts based on number of taxonomy terms matched
- WP the_posts() on single-cars.php get category link
- tax_query not working in template
- Custom Taxonomy Not Showing in Front-End When Outputting a Custom Post Type with WP_Query()
- How to make WP_Query not to show irrelevant posts?
- Create an archive page for custom post type with custom taxonomy
- WP_Query() with custom post type and taxonomy — get all terms?
- Variable not working in WP_Query
- WP_query – Filter by tax_query and meta_query using multiple select
- Wp Query with multiple custom tag(taxonomy) by get the terms
- Custom post type, custom taxonomy, query posts only from taxonomy (children of)
- WP_Query parameter conflict
- how to get this tax_query working?
- How to sort a WP_Query by a custom field AND ALSO filter by a different custom field
- How to get the post terms from a child taxonomy
- display posts of custom post type with custom taxonomy
- Custom post type and custom taxonomy 404 on page 2
- tax_query (if the terms are empty)
- How to count other posts not having specific taxonomy terms?
- Get posts by category name
- WP_Query order custom post type with certain meta key value by post modified date
- Cant’ Display Custom Post Type Title Base on Tax Terms
- Query custom posts from custom taxonomy
- Query Custom Post Type by Taxonomy
- Multiple custom post type queries causing wrong post types to be grabbed in taxonomy + single templates?
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- Related “custom post type” using “custom taxonomy”
- set object terms after some some time of published post – functions.php
- Sort custom posts by date and then by taxonomy
- How to search through all child taxonomies using WP_Query?
- WP_Query based on ‘s’ and tax_queries
- WP_query sort by taxonomy
- Custom Taxonomy – fields
- CPT Loop, include taxonomies and disclude others?
- WP Query tax_query not returning posts
- The most recent post of custom taxonomy
- Why get_posts() returns empty array while I am trying to get posts from some specific taxonomies and work properly with others?
- Problems with the WP_Query query for a Custom post type
- Get posts of an specific term of a custom taxonomy
- Query pulling all taxonomies, not one I am specifying
- Get archive of posts separated by taxonomies and subtaxonomies
- Custom post type and custom taxonomies display
- WP_Query for CPT with filter by another WP_Query
- How to pass taxonomy terms to WP_Query along with $args?
- WordPress custom post type
- Custom Taxonomy Query by Taxonomny not working
- How to query posts by meta keys AND under specific category?
- Shortcode display CPT Query only showing 1 post?
- Post data in separate divs with incrementing class using WP_Query
- Storing/querying custom date data
- WP Query Post Type with same Taxonomy name
- WP Query WordPress Post Type with the same Taxonomy name
- How to list groupings and keep pagination
- How to retrieve taxonomy terms of the current custom post?
- How to Get The Taxonomy Term in Custom Post Type Loop Inside a Wp Query
- display custom post type from register taxonomy
- Sort ACF by custom taxonomy
- Complex Custom Loop with Includes
- Query custom post type and group by taxonomy
- Dynamically count the number of custom post types associated to a custom taxonomy
- WP Query filtering by custom category not showing all relevant posts
- wp_insert_term how to insert “” in description