I would work the code arround and do something like this.
<h1><?php echo get_the_title(); ?> - <?php the_category(', '); ?></h1>
get_the_title();
Retrieve post title.
the_category(', ');
Displays links to categories, each category separated by a comma (if more than one).
Documentation can be founded here : https://codex.wordpress.org/Function_Reference/the_category
Hope it helps you.
Related Posts:
- I want to show category in the post title , how can I do
- How do I include the category next to the title of a post?
- Change Post Title For Specific Category
- How to select a category automatically based on a word in WordPress post title?
- Create/Set Category as Title of Post
- Post Category link is same with Page link
- Is it possible to have different header style blog titles in different categories?
- How to add category to: ‘wp-admin/post-new.php’?
- Use category base slug in posts’ permalink
- Setting Custom Sort Order of Posts within a Category
- Different number of posts in each category
- Display the latest post from a category in a page
- How to show list of posts by author and category?
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- Get title of post without using the_title();
- How to control which category will be picked for the slug of a post?
- get_the_term_list by hierarchy order
- How to change the layout and styling of posts according to their category in WordPress?
- Add default content to post (for specific category)
- Query only Posts from Both of Two Category?
- display sub categories assoccited with each post in a category archive page
- Display most recent post in category instead of archive?
- How can I specify a category post on my home page
- Post in Multiple Categories to stay in current category (permalink, next previous post link)
- get_post_type_archive_link(‘post’) returns current category archive
- Permalink Settings: optional settings doesn’t apply to editor
- Get user’s most published categories
- How Can i Get 5 Recent Post Title With Corresponding Link?
- Random post category URL
- How to set up multiple taxonomies for groups of posts
- How can i sort the categories by ID
- Display posts in three columns by category
- Lose “Blog Archive” from page title
- Add ajax load more function using WP API
- Deleted category by mistake, all posts now have categorized category. Can i revert that?
- Properly display posts on homepage
- Display post X of Y in category
- Duplicate posts and change category
- Exclude category from
- WordPress Multisite – Create Default Post and New Category On New Site Install
- Using ajax on editing a category edit page?
- Disable sticky option for specific categories
- date issue with category post retrival
- How to make multiple sections in home pulling posts category wise?
- Add title for previous and next posts to Yoko Theme
- Limit the number of posts a category can have – newest post goes in, oldest one drops out, possible? plugin?
- How to get subcategories from category slug?
- Showing categories and subcategories with posts
- Change default category when I publish a post
- Loop doesn’t exclude the specified category in home page
- Post Image not displaying in category view
- How to style archive post titles… but only those posts who have comments?
- Parent category / child category posts
- Display post number by category
- Unable to differentiate between two categories under custom post type on single.php
- Exclude post category in a blog page
- Are post, page and category IDs unique to each other?
- Static pages not working
- WP_Query of Category Not Showing First Post
- How to make posts being uncategorized
- How to display a single(current) post from a category
- displaying the categories post
- What’s a theme that properly handles previews of different types of posts?
- How to add content above footer in posts from specific category
- WordPress – When visiting a `single post/ single.php` my category menu item link becomes active
- How to Create another Page Category like the “Post” and “Pages”
- How to create a button to filter posts (list) by meta value
- Is there a way to save different data when USER interacts with the same POST?
- How to display particular categorie’s post which associated to specific user?
- Display Specific Categories posts on the home page
- show only one category and filter by tag
- Post title spoiler how?
- Code to display random ordered posts in Categories across pages [duplicate]
- AJAX load more posts not using correct category and repeating the same few posts
- Category posts show on local install, they do not show on live server
- How can I exclude only a specific sub category post from category display?
- how to print total number of posts filtered by category?
- WordPress not showing recent posts
- Add category information beneath post?
- How can I display a specific number of post in a category via a url
- how to chang preview of list of articles of one category?
- Newly created category does not show category
- Post of a specific category – not to be seen in paging previous/next post
- How to show main category related to that post
- How to pass multiple checkbox values to wordpress query?
- Sort post by category using HTML Select tag
- Make assigning post to a specific category equivalent to assigning it to all categories
- Show a Category Specific Info Box
- How to get all post titles starting with numbers and symbols?
- Display the first post’s comments of category in comments.php template
- How to filter categories of a post
- Single post pagination
- ‘get_previous_post’ in same category returning (!empty) when no previous post in category exists
- List posts related to category on a div [closed]
- how to show all post with its contents
- wordpress show category link instead of post link [closed]
- CSS – Change height of Storefront / WooCommerce product categories, but not products
- How to display my categories in a list (to a post, not the sidebar)?
- How to make category for word post_content
- Site ‘Categories’: save an admin global setting with post metadata [closed]