You must use the ||
code
not &&
I also deleted this code that was wrong in your code
as ;
in the PHP code opener
Code Like This :
<div class="sc-age-group">
<?php
$agegroup = wp_get_post_terms(get_the_ID(), 'camper_grade');
if ($agegroup) {
foreach ($agegroup as $group) {
if ($group->name == "1st Grade" || $group->name == "2nd Grade") { ?>
<div class="sc-age-group_1-2">Grades 1-2</div> <?php
}
}
}
?>
</div>
Related Posts:
- How do I exclude a custom taxonomy from the post loop
- Display category posts grouped by taxonomy
- display posts with same taxonomy term
- Including all terms in wordpress tax_query
- Display one post from each term in a custom taxonomy [closed]
- Is it possible to sort the post based on a custom field?
- Looping Through Custom Tax Terms and Displaying All Posts For Each
- Group posts that matches a term in a loop
- Custom taxonomy template loop
- How to handle “the_terms” inside loop
- Modify main loop in taxonomy archive page
- All posts are still shown when adding category argument to query
- Operations with custom fields values in a loop
- echo current taxonomy id for this loop?
- How do I Use Multiple Loops with WP_Query?
- How to adjust code to refresh a dropdown box with tags that are active on filtered category listing
- How can marge these loop code?
- How do I display a list of posts under all hierarchical children of the current taxonomy?
- Posts in loop displaying all taxonomies
- WordPress Tag or Custom Taxonomy Return All Posts if has that Word in Post Title
- where is the 4th taxonomy terms? taxonomy terms is disaapearing in the loop
- Display all posts that use a custom taxonomy
- If Custom Taxonomy
- How can I reduce amount of ifs and else ifs in this specific block of code?
- Returning One custom taxonomy term name
- Exclude taxonomy term from all loops, but having it on widget
- Using WP_Query and Query_post for the loop?
- Loop to display ONLY custom taxonomy parent information [closed]
- Loop through custom taxanomy in post and display custom fields from posts
- List terms of custom taxonomy if matches other taxonomy
- Only display latest custom taxonomy post
- how to get the post id in the option tag
- How to get the term description in a taxonomy term archive query?
- Chaining Taxonomy Queries
- Problem with sorting in custom child taxonomy archive page
- How to add a shortcode function that returns the taxonomy slug of the actual post within the loop
- Group posts in a category based on tags in custom taxonomy
- Get post meta value outside of the loop
- ACF – Get unique values of array
- Remove Custom metabox from particular page template is used
- Custom taxonomy shows full articles
- Is it possible to sort the post based on a custom field?
- Output slugs to use as class names for every taxonomy a post is attached to
- Multi level archive
- List active taxonomy terms
- sort Posts by custom user filed
- How to get name of custom taxonomy
- Query pages by child term
- Query Number of Loaded Posts in Loop
- Trying to achieve row posts below category with multiple loops in custom tax
- Custom Taxonomy + JQuery Tabs
- WordPress show posts from children terms of a taxonomy term
- Loop custom post type by taxonomy (Category)
- Get custom taxonomy value of post and output posts in same taxonomy
- How do I create a term for every value of a post meta?
- How home my code doesn’t display any feature image? Looping through post from a taxonomy and not getting feature images back
- Loop posts without any taxonomy
- How to looping taxonomy terms?
- Retrieve posts by term id custom query
- Is there a way to disable a term rather than deleting it?
- SQL QUERY needed to get POST category (taxonomy) ? – MUST be SQL statement
- Remove Category description textarea
- How to use wp_terms_checklist() on front end
- Display Custom Taxonomy Terns ordered by meta_value
- Display custom taxonomy for product
- Problem with query_posts for a custom taxonomy in theme options
- Function to limit the number of posts in taxonomy.php
- How To Capitalize Entries In the Taxonomy Box?
- How to filter WordPress search, excluding post in some custom taxonomies?
- Custom taxonomies making WP very slow – Way to fix?
- Custom user taxonomies fail when i register multiple taxonomies
- Top level parent taxonomy ID
- Date range filter for manage posts list on edit.php
- How to Filter Posts by Custom Fields?
- Selecting all posts from the children of a particular parent taxonomy
- How to get all taxonomies which can be added in menu?
- Select multiple categories from CPT to display in LayersWP builder widget
- Display value of custom field of custom taxonomy in single post?
- Custom Taxonomy and Rewrite URL
- WordPress Custom post query sorting does not work
- group posts by taxonomy terms
- How to create a custom taxonomy using a shortcode?
- Custom URLs in Custom Search Results
- how to extract the username of the wordpress user?
- WordPress set taxonomy on post?
- Custom Post Type not showing in main loop
- Best way to redirect taxonomy terms to pages
- WordPress cannot find user taxonomies on frontend
- Hide echo of no categories from get_object_taxonomies
- How Can I Remove Child Slug From Grandchild Slug When Using Duplicate Grandchild Slugs?
- How to filter and/or sort user taxonomy query inside custom user taxonomy archive page?
- List posts with slug title
- Get Highest and Lowest get_term_meta() value from Taxonomy Term
- Get the terms of a post
- index.php Not Showing Custom Posts / Terms
- How to make my taxonomy URL work?
- Index page of posts tagged with two separate taxonomies
- stdClass::$labels /wp-includes/general-template.php undefined
- Custom taxonomy in short code
- An unidentified error has occurred when deleting a category