You can use get_the_category_list()
, which returns a list of categories assigned to the post (each category in the list links to the category archive):
printf(
'<span class="posted-on">last updated on %1$s</span><span class="byline"> <i class="fa fa-user"></i> %2$s</span> in %3$s',
sprintf(
'<a href="https://wordpress.stackexchange.com/questions/338246/%1$s" rel="bookmark">%2$s</a>',
esc_url( get_permalink() ),
$time_string
),
sprintf(
'<span class="author vcard"><a class="url fn n" href="https://wordpress.stackexchange.com/questions/338246/%1$s">%2$s</a></span>',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_html( get_the_author() )
),
get_the_category_list( ', ' )
);
Related Posts:
- How to add a new product type on woocommerce product types? [closed]
- How to get current_cat in navbar, in single post
- Updating WordPress overwriting customization tweaks – strategies?
- How to customize the default HTML for WordPress Attachments
- How can I get posts in a subcategory to display on it’s parent categories archive page?
- wp_trim_words() does not trim the_content() in WordPress
- Custom category order with get_categories
- page_template toggle between 2 templates + 2 permalinks for same post
- Create single.php for specific category by category id
- Make page template that is just an “include” of another?
- Custom php file in wordpress
- Selecting An image from the Media LIbrary on the frontend
- Custom sidebar category listing?
- Auto add taxonomy if post has category
- Apply custom category template to subcategories
- WordPress Template not affecting the working, keeps defaulting to the index.php template
- Recommend an open source, template driven website builder UI that produces a working WordPress site [closed]
- For custom templates, is it better to use `template_include` or `type_template`?
- Create default_content layout template based on post id
- Remove template drop down for certain pages
- How do I add a new template to my site
- Show posts on a page based on a category and tag(s)
- Query posts by category AND custom field, then ORDERBY another custom field – help!
- How to add “Read More…” link in twentytwenty
- How to customize core admin pages within a theme?
- How can I make site-wide content editable, for example footer content
- Query post for ‘selected category’ in archive.php
- how to get the categories for a single product in a hierarchical way
- Automatically check parents (in a taxonomy) when child is selected
- Showcase elementor templates
- Category selectable homepage
- How to get custom page template being edited in gutenberg editor
- How to change the category url jusy show /category/%category_id% in wordpress?
- Make custom page look exactly as homepage
- Best practice – pages – ACF or inline coding
- Set Title from Custom Template
- How to hook up search results page to a back-end page?
- How can I create a permalink with two categories, with the order based on the parent category?
- how to show only specific category for a template
- How To Load an HTML File As A WordPress Page (With No 301/No Redirect)
- Is there a way to by-pass the pagination function on one custom template?
- How do I list custom taxonomy terms with the links?
- Editing a post template
- WordPress archive index page
- How to get the current category with custom posts
- How to add custom ‘layout’ buttons to wordpress editor?
- How to create custom layouts and static pages in themes for clients
- Custom Content Page
- Create a Page template selector page
- Creating custom page template
- Get whole linked with wp_list_pages
- Force WordPress to load a specific template
- I would like to feature a tip on the homepage
- Adding Multiple “Parents” in get_categories
- Dynamic Sidebars based on page name
- Translate custom template with WPML
- How To make Custom page of every Category
- How to setup a membership system in WordPress?
- Make the home page template my archive/category page template without code duplication
- Get custom text if in Category
- Create Miltiple Category Base
- why won’t my custom css load with the enqueue method or any other method?
- Is it possible to edit a wordpress category with Gutenberg?
- How to show related post with category DESC (ASC) IDs of ID current post
- Conflict between Yoast SEO and my custom theme
- Hide entry-header for a specific category
- How to add a template – so that i can choose a different menu for some pages
- How can I delete the word `Category:` from page titles? [duplicate]
- Why does a custom php code inside a custom template not get executed?
- wordpress custom posts page not showing
- How do I target this page specifically?
- How to use a custom playlist template:
- Category custom template is not showing correct posts
- Still desperate about multiple TinyMCEs in widgets – is there any good solution to this yet?
- Displaying Child Page’s Information
- Getting a jQuery library to work in WordPress & Avada
- Use another theme template in my theme
- Show posts from all categories
- Redirect Every Instance of The Author Template Pages to Custom Author Pages
- Getting page/category content to show up in my custom page template
- Allow arbitrary text after page URL
- Taxonomy template by post type
- Best way to create a page outside of the pages list
- Template setting is not saving in wordpress
- Make Terms Under Custom Taxonomy Use Specific Single.php Template
- Custom single page based on which custom page template is selected
- Single page template
- Post thats in Two Categories, only want to display name for one
- Modifying a local template
- Custom template not working for existing pages [closed]
- woocommerce display product category on checkout page [closed]
- How to apply styles to the custom page template
- Prevent posts from being published if the ‘Uncategorized’-category or no category is selected
- Show last child Child category instead of first child category on page
- wordpress categories narrow down results
- Modifying posts based on category in TwentyTwentyTwo theme
- Create a page for each database table entries
- Can’t change WordPress / WooCommerce attribute value order
- How to edit the new user email notification template
- Block Theme: How to use a different template on front page vs paginated pages?