What you are looking for is get_the_category(). Retrieve a list of the categories, and then run a loop and only output their names:
$categories = get_the_category();
if ( ! empty( $categories ) ) {
foreach( $categories as $category ){
echo esc_html( $category->name );
}
}
This function returns an array of WP_Term objects. You can check the provided link for a list of available methods.
Related Posts:
- Preserving theme settings in child theme
- Is it possible to make grandchild themes?
- Cannot get Child Theme to load latest version of style.css
- Issues enqueueing parent & child theme stylesheets with revised Codex method
- get_parent_theme_file_path vs. get_template_directory
- Child theme does not overwrite parent themes style.css
- How to use parent theme’s enqueue methods
- How do I override a parent theme’s language files with a child theme?
- How to solve “Warning: Use of undefined constant” when overriding a parent theme function in the child theme?
- Do I need to update the child theme too after updating the parent?
- get_template_directory vs get_stylesheet_directory
- Developing a childtheme, how to disable the parents templates?
- Use admin options from parent theme in child theme
- Overriding parent theme file
- How can I make new .css file in child theme override styles in child theme’s style.css
- Overiding functions.php with child-theme
- How do I set up a child-theme without using @import
- Find a Parent Theme’s stylesheet $handle when it registers a stylesheet
- How to change default header image dimensions in twentyfourteen child theme?
- Overwrite CSS with without deleting it
- Adding or modifying in files of parent theme via child’s function.php
- Website Broken on Activating Child Theme! [closed]
- Child theme implementation issues
- Hide post meta data on a specific category
- Child Theme Path Being Ignored With wp_enqueue_scripts
- ERROR MESSAGE: Missing index.php—Child Theme
- Child theme undefined variable error
- get_theme_mod is returning a number rather than my image file
- Child theme style repeated
- bbpress change the word forum, topic, reply in the forum to another word I choose
- wp_add_inline_script not adding when script_loader_tag filtered
- the file placed in the child theme is not included
- How to NOT call Font Awesome or font icons in WordPress
- Child theme grabbing wrong location fo parent theme files
- Specific custom child theme page
- WordPress Child theme’s css not loading
- Child theme works in local environment but is not working on remote
- Tesseract child theme loads slow [closed]
- Confused about how to use wp_enqueue_style
- How to use custom stylesheet only for a template in child theme
- Order of stylesheets in child theme
- Creating a child theme from Twenty Seventeen
- Adding a title below the logo
- How can I make this Advanced Custom Field Save & Store local json work?
- How to create a parent theme for accesspress parallax theme?
- How to add anchor tag at the top of posts, past the header and nav bar?
- How do WP child-themes work? [closed]
- Is a Child Theme required?
- Moving from parent theme to child theme without losing configurations
- can the footer be included on a child theme
- How change child theme’s boxed layout to fullwidth in genesis? [closed]
- javascript not being enqueued correctly
- styles from child theme not loaded for file other than style.css
- Multiple Child Themes
- How to install Bootstrap in a WordPress child theme
- Fatal error and use of undefined constant in child theme unless I redefine it
- wp_get_current_user() and is_user_logged_in() in child theme’s functions.php file don’t work
- Trouble translating a Child Theme
- Child Theme Customizer not working
- Child theme with flatsome theme crashes website
- How to make child theme in wordpress with wp_enqueue_style ? Using Enough Theme
- Customize file on inc folder on child theme
- Proper way to show admin bar in HTML5 Blank theme
- I want to edit it on my laptop as a child theme and transfer the files to my server. I don’t know how
- Adding function from parent theme to child theme
- Translated words not showing child theme
- How to create a non-responsive WordPress Theme Using Genesis Framework?
- Correct way to customise a child theme
- Stylesheet overriding in Child theme
- Modify Twentyeleven child theme CSS – How to change body font size?
- Child-Theme Category View with modified permalinks (%category% removed)
- Child theme is not rendering parent and own javascripts (but css loaded properly, js not)
- Child theme stylesheet not reflecting the changes
- Best way to edit/change comment-template.php without changing the core
- How to stop customizer settings inheritance from parent to child theme?
- Making a child theme in order to update the parent theme
- change html and css in template files in child theme
- My wordpress site is crash due to excute child theme
- Why does my child theme’s enqueue of styles mess up the order of script enqueues from the main theme?
- Where can I edit/see the HTML of this WordPress free theme?
- Enqueuing multiple stylesheets with a child theme
- menu, header and footer is not shown in the appearance after creating the child theme
- The parent theme is missing. Please install the “bp-default” parent theme
- how to fix loading scripts in child theme?
- Deregister wordpress script in child theme by js location
- Adding translation files to a child theme
- is it ok to dequeue default parent stylesheet from custom page templates in child theme?
- Why won’t my Custom CSS Load
- child theme performance / avoid import and minify JS files
- Remove HTML from search.php of my parent theme
- Prevent child theme from inheriting a parent theme’s required file
- About wordpress child themes
- Body classes in child theme
- Edit copyright in Hesita Child Theme
- Can anyone help me with replace genesis post excerpt with yoast meta description and if there is no meta description show the excerpt?
- Child theme customizer preview doesn’t work/load
- theme.json should be in the child theme folder when using xxxx.json style located in the styles folder?
- Modifying posts based on category in TwentyTwentyTwo theme
- Twenty Twenty One update changes dom classes and breaks my child theme
- How can I add ReactJS to the child theme?