You’re on the right path. You can add classes to your content in the loop based on the terms assigned to each piece of work. For example,
<?php if( has_term( $term, $taxonomy, $post ) ) { $work_classes="big-item"; } ?>
<div class="<?php echo $work_classes; ?>"> ... </div>
This only adds the class big-item
when the taxonomy term exists on that post. To get has_ter to work, fill in $term with the slug, $taxonomy with the taxonomy slug, and $post with the post id or object.
More information: https://codex.wordpress.org/Function_Reference/has_term
Related Posts:
- Display category name on featured image in wordpress excerpt
- How to create an automatic MultiColoumn MegaMenu with Categories WordPress
- Can I set a default featured image for a category?
- How can I add the featured image functionality to a custom taxonomy?
- How can I make post fields required in WordPress?
- How to add a background image to category and display image on category page
- Create a full width responsive header image per page
- Remove “Category Archives: title” at the top of a category page [duplicate]
- Hide post meta data on a specific category
- Display the featured image from the last post
- Display child categories in WooCommerce
- How to make a Thumbnails Mosaic
- Highlight wp_nav_menu when category is selected
- Category location styling
- Category index featured image
- Hide woocommerce category name from specific pages
- Hide woocommerce category name from specific pages
- Style category link depending on category ID
- Inside a loop, how to change CSS class based on category name?
- Redirect to another page using contact form 7? [closed]
- Display thumbnails for certain category posts
- Why do I have stray bullet from
- Random Featured Image Based on Category
- How to add custom color fields to the category edit page?
- Category images are not displaying in WordPress
- why get_the_post_thumbnail( the_ID()) echos extra post id
- Different CSS class by category
- Simple way to style posts of a single category differently in the loop and in single
- Remove Archive | from Categories
- Custom css per category and per single post belong in each category
- Restrict CSS on one page
- Category view with contents of [gallery]s shown
- Random category with recent post title and thumbnail
- Show Secondary Sidebar on Category pages (archive)
- How to add icon over specific thumb
- Display post thumbnail for specific category outside the loop
- How to add image for all posts associated to specified category?
- How to get sub-categories to display same look as there parents
- How to display WooCommerce category image in my category page banner as a background?
- category description not showing in my woocommerce
- Inline If statement to echo CSS [closed]
- How to make product image inherit from category image
- show thumbnail for subcategory wordpress
- How to “remove” WordPress categories UL and make the list loop in a horizontal line?
- How to add excerpt and read more button to category archive page
- How to hide/remove featured images in particular categories post?
- Custom field picture instead of post thumbnail on category page
- Custom CSS to resize elements in multiple categories
- Display last postings of 5 categories on homepage
- How to enable admins/editors to set a featured image for specific category?
- WordPress excerpt for specific posts in category
- Way to show content of a post, but if exceeds character limit revert to excerpt?
- Featured image for links and categories
- Custom Woocommerce Category view
- Broken category styling
- How can i hide the authors box from a specific set of categories and post types?
- How to prevent page re-sizing for mobile browsers [closed]
- Show thumbnails 1-12 of category x on any given page
- How to display the category featured images [closed]
- In my wordpress admin panel Suddenly The Category, tag and featured Image Option are not showing
- How to hide my categories pages’ names, and how as well to reduce the space beween my sidebar’s widgets?
- How can I get the categories and subcategories separately?
- Elementor : display only one category in loop grid
- change the listing type of categories block?
- Some of the category description not showing up in category page
- How to Link to Most Recent Custom Post of Same Term
- WP REST API not retrieving all categories
- How to display a value inside a post with a specified category from a category custom field? [closed]
- On the Blogpost I have categories showing, is there a way to exclude a catgegory like ‘Media’?
- Function to automatically rename the base category permalink
- Hide specific category from wp_list_categories
- Add theme-color meta tag to head?
- Some categories missing on wp-admin/edit-tags.php?taxonomy=category
- How to get an array with all categories and corresponding names?
- Add custom code at start and end of all posts in a category
- Is it possible to have a template that works on multiple categories where the link address contains the specific category?
- How can you access category information from a theme?
- Get custom title if category
- How to get posts by category at /%category%/ url?
- Echo text using is_tag
- How to add animation the featured image?
- List just subcategory and products of active category page in Woocommerce
- Custom Meta Box (SELECT2) Not Saving Taxonomy Terms
- Cannon see subcategory in permalink
- Link To Child Category For A Post
- How do I add a separator to my list of terms with get_category
- How to display the parent category if only the child category has been chosen
- About title on a page
- List a maximum of ‘x’ product categories with qty of ‘y’ in each column
- Display all product tags associated with a specific product category
- How replace individual elements in the RSS feed with a single string
- Multiple Category Search with and operator in WordPress
- I want to know how to output child categories related to parent categories
- get_posts() from parent category only using a shortcode
- custom page for custom Taxonomy
- Category tags with comma’s
- How to show a list of only categories (exclude subcategories)
- How to list categories in reverse alphabetical order?
- Why get_category() function is not working not working when embedded in a page?
- I want to show category name when using [category] shortcode