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?
- List all subcategories from category
- Display all posts in category, with specific tag posts at top
- How to Set an Individual Homepage for Each User?
- Woocommerce – Get product category 2nd level category
- How can I get an tag to wrap each ancestor that gets outputted in this condition?
- How to prevent empty category to list content of sub categories?
- Use a wordpress page to display a certain category
- Need to pull parent category and slug – only pulling daughter category
- WordPress category page redirects in .htaccess not working
- Change thumbnail image depending product category
- How to organize custom categories for filtering and selecting
- category doesn’t showing up in admin
- Get category URL knowing it’s id
- How to make subcategory for custom post and and display?
- Create menu locations for each category in wordpress
- How to make the ‘delete’ button inactive on some categories?
- Array: What is this value based on?
- WordPress list categories dropdown with parent-child relation and child under it’s parent
- How to Link to Most Recent Custom Post of Same Term
- WP REST API not retrieving all categories
- Category page not showing
- How to only show parent categories in sidebar
- Change RSS format for specific categories
- Displaying a custom field in Category Archives
- List post only under the category, exclude child category content
- Custom Fields Value As Taxonomy
- Redirect Problems with Archive Page and GET variables
- Different size video display for category page (smaller) & detail page (larger)
- Adding tinymce to Custom Field boxes on Category edit page
- Display the articles of a category by role
- Remove “Category:” from Post meta
- Dynamically creating content on custom URL without getting 404
- Category foreach Paging
- One category not displaying template updates
- How to display only category of blog without custom code?
- Form Value of drop down category + Translation of ‘show option none’
- How to display posts by author in a separate page, other than author.php?
- One color to category link depending on category ID
- How to display my categories in a list (to a post, not the sidebar)?