Jump to content

How To Add Category Name to H1 Blog Title..?


Taffy1957

Recommended Posts

Hi Guys (& Ladies of course) 

 

I'm having a problem trying to add post category to the H1 title, I have managed to butcher my theme so that the single post now removes the H1 from the title in the header & instead adds it to the post title.

 

But what I'd like to do now is keep the H1 blog title on all pages including home page, but I'd like to ammend the title with the addition of the post category, as follows;

 

currently shows "Top Rated Gadgets" on all pages.

 

would like it to show "Top Rated (category name)" when viewing a single post.

 

So if the category of the post was Asus Laptops it would show "Top Rated Asus Laptops" instead of the usual "Top Rated Gadgets"

 

The closest I have got to it so far is with

<?php the_category(', '); ?>

but this returns a hyperlink ! Is there any method I can use that will simply return the category name as plain text..?

 

Any help would be much appreciated 

 

Thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.