I’m not aware of a built-in function like “get_cat_name_by_desc()”, but you can use the description__like
parameter along with get_categories()
or get_terms()
:
$cats = get_categories( [
'description__like' => 'foo desc',
'hide_empty' => false, // disabled for testing purposes
] );
echo isset( $cats[0] ) ? $cats[0]->name : 'No categories found.';
Related Posts:
- List all subcategories from category
- Get category ID from category slug (not working)
- How do I remove “Uncategorized” from posts with more than 1 category?
- Remove parent category from permalink? Basically only have the child category?
- Control term order on a per-post basis
- Filter by post category in Media Library
- Changing Top Level Items into Radio Buttons in the Categories Meta Box?
- Custom post types with their own permalink structure
- Display all posts in category, with specific tag posts at top
- How to create a widgetized sidebar for every category dynamically?
- Send an email when custom post type category is changed
- How to Set an Individual Homepage for Each User?
- Display the deepest child category from Category X (in loop)
- When using get_categories or similar, is it possible to filter results that contain certain Tags as well?
- Exclude subcategories from the url
- Why adding Categories does not auto refresh in Backend while using my custom theme?
- Select category in custom query
- Removed slug from CPT, now How/where do I hook the filter to the taxonomy term archive pages link?
- Remove specific category from a post
- Search by word, category, tag, author
- How to hide certain categories in wordpress dashboard?
- How to filter archives both by category and tag?
- Resolved – category-slug.php not working after wordpress migration
- How to retain the values from dropdown category lists after wrong form submission?
- How i can let users add notes to my posts
- Woocommerce – Get product category 2nd level category
- Hide post meta data on a specific 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?
- Single_cat_title() print the title before text
- Sort posts by post_type in category.php template
- Why would in_category only return one post in a specific category?
- Is it possible to have WordPress not recognize category URLs?
- Disallow categories from this MySQL query
- Use a wordpress page to display a certain category
- getting content from main domain to sub-domain using category and WP_Query
- Force a user’s posts category
- How to list child categories?
- Checking for two categories in query_posts
- get_the_categories filter returns an empty array
- Creating gallery with taxonomy images plugin?
- Full text articles in the rss feed (i.e. without the more tag)
- Solution for ascending order in a category
- Restoring default article pagination on archives – Removing custom limits
- Show category to visitors in different name or different language without changing basic category
- how to get child category title and image
- How to get latest posts from each category in regular order
- limit a list of tags to one category [closed]
- How many categories can WordPress handle before performance suffers?
- Get sort order of product categories
- Show Posts from Single Category Not Working
- How to pull a list of posts in a category while exluding posts in subcategories of the category
- Exclude category from query
- Functions.php: Exclude Category from “Blog”
- How to loop custom post_type from (a) specific category(ies)?
- Category images are not displaying in WordPress
- Display posts of certain categories to specific user roles
- How to restrict category creation to admins only while allowing editors to still pick category
- Show child taxonomies (that have posts) of the current parent taxonomy
- Display Related Posts by “Category” “by Author”
- Query (built in) Categories and Advanced Custom Fields?
- Get next post in same category not working WP 4.7.4
- Change post title if post has specific category
- Filter By Category Dropdown List With Custom Taxonomies
- query_posts by category_name and custom taxonomy
- Page that links to category content
- url for posts for a date within a category
- Query from multiple category (and)
- Wp Dropdown Category Not Show Current As Title
- How to load several hierarchical categories from functions.php
- Autolinking keywords in text with tags
- WP E-Commerce creating categories programmaticaly [closed]
- How to get the deleted category id?
- Maintaining a separate posts page for certain categories and don’t show those on home page
- WP E-Commerce WPEC 3.8 Sort Categories
- How do I list only children of a specific category in a drop-down?
- Link posts together (relative, not grouped)
- Creating a Blog with numerous categories
- Different post slug based on archive
- How do I get conditional sidebars for specific category archives and posts
- How to hide description on categories and tags?
- Exclude a category from block editor’s category widget
- Replace deprecated get_category_children code with get_terms
- How to “remove” WordPress categories UL and make the list loop in a horizontal line?
- How do I rewrite a single category link to point to a custom page?
- Add subcategories posts to the counts column at the admin’s categories list
- Default category isn’t saved in database
- Display one post on category.php: Wrong featured image
- Display related posts with same category or same tag return blank
- Get posts from 2 or more categories
- Category foreach Paging
- date.php shows all posts. how to fix it?
- Help with Wp + Mixitup code
- One category not displaying template updates
- Matching usermeta at registration to categories of content
- How do I hide posts in a category from all listings but still allow the posts to be viewed?
- How to get Woocomerce categories count
- show posts from some category and sort by advance custom field
- How to show monthly archive posts?
- How to display posts by author in a separate page, other than author.php?