<?php
foreach((get_the_category()) as $category) {
if ($category->category_parent == '7') {
echo '<a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf(__( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> ';
}
}
?>
All you need to do is replace 7 with whatever category you want to include
Related Posts:
- Force category choice before creating new post?
- How to remove category from wordpress url?
- How to create a custom url for a category [closed]
- How to get primary category name in WordPress new version
- Rearranging posts based on categories
- How to create category index table out of wordpress site or on other website?
- Custom Nav Walker menu – Display category count
- Multisite blog converting categories to subdomains
- Display posts links from a category group by year
- List categories for author: list_categories function inside list_authors function
- Redirecting specific category to subdomain
- How to make all posts in a category sticky?
- WordPress: category page not for post’s
- WordPress check if user is logged in from non wordpress page
- Automatically assign posts by author to a specific category
- How to show empty category in admin menus search
- Categories and Tags returning 404 on the sidebar when using ugly permalinks
- How do I remove the tags from wp_list_categories?
- How to insert category and subcategory using ‘wp_insert_post’ function?
- How to group the loop posts in a particular by author?
- How to display get_the_category of post showing only CHILD of category “X”
- Get ID of current taxonomy in register_rest_field
- display woocommerce all category title on home page
- Custom page for WooCommerce’s /product-category/
- Add Class While on Current Post; wp_list_categories
- get all sub categories without specify any category
- How to use wp_category_checklist()?
- Get the name an the description of a link category
- Display child categories in WooCommerce
- WooCommerce duplicate sub categories and product slugs
- Check child/parent categories if exists
- How to run select query of post with category and tags for API?
- How to show only one category in breadcrumb navigation
- Trying to only display 1 category using get_posts
- How to display singular form of category name?
- Populate dropdown based on selection of parent category
- Categories for each brands
- Custom User-Created RSS Feed
- query cat orderby and order not working
- Permalinks: display just one kind of wp category in the posts url
- WooCommerce – How to show specific category first-rest of products-specific category last
- Multiple URL’s based on category for one post
- WordPress category check
- get_post_meta not working on category.php
- How can I improve this taxonomy treating approach?
- How to show more than 5 posts of the category?
- Can’t delete a category in WordPress
- Dropdown Categories used in form shows no results when all is selected
- Nicer URL for viewing category of posts?
- Get Categories Where Taxonomy Equals ‘n’
- Odd results in get_the_terms vs wp_get_post_terms
- Grandchild Term Things Grandfather Term is It’s Parent
- get full category structure by post id
- Remove Archive | from Categories
- Showing Categories for Page Edit – without plugin
- Using categories with pages
- Show next post in same category but start from the latest
- Only first category!
- How could I write a get_categories_by_year() function?
- How to add icon over specific thumb
- Can I define multiple paginations on a single page?
- Echo Category Nicename
- Explode() expects a string
- How to add meta description, keywords, custom title to a category template
- User level categories
- Exclude category from drop down list form
- Sort posts by child category name
- Intermittent Gutenberg 504 Gateway Timeout when calling REST route to retrieve categories
- Automatically add custom taxonomy to posts in a category
- WordPress Portofolio Conditional Templating – functions php
- Category page 404s on mobile but not desktop?
- I want to create a custom taxonomy page showing a list of subcategories
- Displaying data from custom fields on a specific category page
- Get WooCommerce product category list in functions.php
- How can I restrict the categories users can post in, based on user roles?
- How to define a post category undeletable by other users?
- Displaying portions of multiple pages from a given category, in a single summary page
- Change wp_link_pages to link to another page
- Is there a way to order categories?
- Categorizing Just Imported Posts
- Post url rewriting for posts with certain category
- Hide post category name wherever it might be mentioned
- wp_category_checklist won’t show up for non-admin users
- get_the_terms_list output last child only
- Exclude posts with certain tags in category archive
- How to make all post in to a category?
- In a shared site, how to get products in a category from one site to another?
- How to loop through a custom field for each post, & display?
- How to add additional field to Add new category part (without plugin use) [closed]
- show category name before first posts in each category
- Lowest catagory link
- Automatic menu creation for pages with categories?
- Displaying posts from a Category where the Category ID or slug is not known
- Custom CSS to resize elements in multiple categories
- Show posted on date only for posts in a certain category
- Page redirecting to category (IE only)
- list taxonomy based on taxonomy
- How can I get rid of the the category suffix–NOT “prefix” (i.e. foo-1, foo-2, etc)
- Why Pagination is not working on Category.php
- Listing categories on a wordpress page