enter image description here

How to add Category name to post title ? “PostTitle + CategoryName”?


You can use the function wp_get_post_categories to loop over the posts categories.

See Wordpress Docs for more info


You can use <?php the_category();?> function to retreive the name of the category.

Using a hook provided by your theme you can place the above function next to the post title.

Example -

`function catname() { echo the_category(); }


This is just an example code.

If not hook then maybe you need to add it to the single post template using a child theme next to the post title i.e the_title();


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.