$args = array( 'post_type' => 'inspirations', 'posts_per_page' => 10 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) :
$loop->the_post();
$collections="";
foreach ( (array) wp_get_post_terms( get_the_ID(), 'collections') as $collection ) {
if ( empty($collection->slug ) )
continue;
$collections .= ' collection-' . sanitize_html_class($collection->slug, $collection->term_id);
}
echo '<div class="inspirations-post '. $collections . '">';
the_title();
echo '<div class="entry-content">';
the_excerpt();
echo '</div>';
echo '</div>';
endwhile;
Related Posts:
- How to modify a taxonomy that’s already registered
- Remove taxonomy base or term from url
- Bulk term assignment for attachment taxonomies
- Why is my working Custom Taxonomy not in get_taxonomies array?
- Custom taxonomy listing page when no term set (all terms)
- Custom order of terms for custom taxonomy in admin and website
- RSS Feed for posts containing any term from a taxonomy
- Taxonomy slug by term ID
- How to enable hierarchical permalinks for hierarchical taxonomies
- Exclude Child Term Posts from Parent Term Archive
- Create taxonomy with meta term using the WP Rest Api
- Use custom posts as taxonomy term meta replacement?
- Remove description in custom taxonomy edit screen
- Taxonomies not appearing in columns on dashboard
- How to output the taxonomy term name in a widget
- Make Custom Taxonomy Category Use Parent Template
- Custom taxonomy template not working
- How to call custom taxonomy categories with shortcodes
- How to get terms of a custom post type in a loop inside footer.php
- List only first-level children of specific custom taxonomy term
- Sorting Posts Via Custom Taxonomy Values Using Checkboxes?
- get / list categories and counts filtered by custom taxonomy term
- How do I make a custom taxomony appear like tags?
- Refine user taxonomy query based on role
- Get ID and slug from taxonomy object
- List the number of posts for each custom taxonomy and specific custom field value
- How can I conditionally change the title of a taxonomy meta box?
- Recreating the hierarchy of taxonomies for a dropdown form menu?
- meta_key & meta_value not working with get_pages and custom taxonomy
- showing custom taxonomies w/custom post type
- Display sub categories and their data of a taxonomy
- Exclude Taxonomy Terms from Template Via Back End?
- wp_insert_post not updating custom taxonomy selected if logged in as a subscriber
- How to overwrite registered taxonomy url from vendor plugin in child theme
- Dynamic loading of Archive content based on custom taxonomy term name
- Checking return with WP Error
- Why is the custom taxonomy archive page redirecting me to a single post? [closed]
- Rewrite URL for taxonomy listing
- Add multiple taxonomy filters to edit.php that support search
- Set taxonomy fields on post with AJAX
- Custom Taxonomy index/archive hierarchy
- Show related posts that match two categories
- Failure to add term meta
- Filter custom taxonomy archive posts by 2nd custom taxonomy using select dropdown
- How to show all post related taxonomies
- Removing “s” from search with custom parameters
- get_term_children returns unknown int though term has no child
- Limit number of posts in wp loop
- Custom taxonomy pagination
- Get the taxonomy of the post
- using wp_tag_cloud with custom taxonomy
- Custom taxonomy not showing terms in post area
- Get object for a few selected taxonomies
- Handling Multi-level custom taxonomy hierarchy
- Problem with wordpress pagination
- link directly to custom post if there is only one in the taxonomy
- Add a term to list in block editor taxonomy sidebar
- Reverse order of posts in a certain taxonomy archive?
- Show only the sub-categories (and their content) of the current custom taxonomy with ‘taxonomy.php’
- WordPress modify Settings > Permalinks (options-permalink.php) Add CPT Permalink Options
- How do I make multiple dependent input fields that use the jquery autocomplete function?
- Also show terms that are related to draft and pending posts
- Breaking Bootstrap Grid at Post Count with Tax Terms
- W3 total cache – white screen of death when trying to show certain taxonomies [closed]
- How to get this value inside RETURN
- Custom taxonomy page not working
- What is the best way to change sidebars based on custom taxonomy terms?
- Displaying the post count of all custom taxonomy terms in a list format
- How to update post taxonomies (Creating a custom UI for Custom Taxonomy)
- Taxonomy dropdown metabox in the back-end
- Taxonomy archive uses incorrect template when query strings are used
- wordpress mysql / wpdb ajax load more for terms help
- Get child product categories from parent product category for CUSTOM TAXONOMY archive page
- How to get related taxonomies based on a category with mysql query?
- Reorder a page of posts of a certain taxonomy/value by a custom field
- Get children of taxonomies
- Yoast – Custom Taxonomy – primary category
- List all taxonomies with their descriptions
- ACF Field, hide taxonomy title and image when no nothing selected in post
- Unregistered taxonomy apears still as emtpy filter list
- How to pass posts_per_page and paged params query vars to custom taxonomy archive urls?
- How to paginate with an query var appended to permalink?
- Use custom taxonomy terms as parent for pages
- Get Highest and Lowest get_term_meta() value from Taxonomy Term
- Custom taxonomy return 404
- add_rewrite_rule using custom taxonomy and year
- index.php Not Showing Custom Posts / Terms
- switch statement for taxonomy content
- Index page of posts tagged with two separate taxonomies
- Multiple Taxonomy in URL/Query – No Custom Post Type
- Calling Custom Taxonomy Dropdown in Form
- Displaying Custom Taxonomy List Posts By Slug?
- Show different sidebar on taxonomy pages when a default is set
- Taxonomy Extra Meta [duplicate]
- How can I get parent term from a child term
- Custom Taxonomy – Archive for the whole Custom Taxonomy (and not just single term)?
- get_terms() – unexpected ‘=>’ (T_DOUBLE_ARROW) error
- ACF Display Taxonomy Image Field
- Guest author – URL, base and custom taxonomy – working but unstable
- Hide empty categories on widget