• 0

Add Category Titles to Category Pages Possible?


Question

Posted · Report post

I would like to add a category title on my pages at top... not the usual post info metabar...

 

Frameworks I've added this to the function file... which would create an H1 Title for the category page.

//ADD CATEGORY TITLE AT TOP OF CAT PAGES
add_action('pagelines_inside_top_postloop','cat_title');
function cat_title(){
if ( is_category() ) {
?>
<h1 class="cat-title"><?php single_cat_title(); ?></h1>
<?php
}
}

What would be the proper action? or is there a simpler way?

 

Please advise.

Share this post


Link to post
Share on other sites

3 answers to this question

  • 0

Posted · Report post

Anca,

 

It may be simpler than that!

 

http://codex.wordpress.org/Function_Reference/single_cat_title

 

There's a simple PHP snippet in there (1st one) that can be converted to a shortcode with a plugin I'm sure you know... Shortcode Exec PHP.

 

Add text area into your category template, above the postloop and drop the shortcode into it. Save and you should have title!

1 person likes this

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Thanks Rob... that worked great.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

I'm very, very happy to hear that!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now