Jump to content
Sign in to follow this  
adwiz

How to modify category header on category pages?

Recommended Posts

adwiz

I want my category pages to not show the gray bar that says "currently viewing category 'Catname'" but instead just show the category name in an h1 style. I was wondering if there's a way to do that without hacking the actual PlatformPro category page template.

Share this post


Link to post
Share on other sites
catrina

You can hide it by adding this CSS to the custom CSS area in your settings:

div.currents_posts_info {display: none;}


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
adwiz

Thanks, Catrina. I would prefer to just show the category name where the title appears. For example, for the category "News" I want the headline "News" to appear in the h1 style, and for the category "Articles" I want the headline "Articles" to appear there. It looks like I'll have to hack the actual template file to make a change like this. Is that correct?

Share this post


Link to post
Share on other sites
kgstew

You are going to have to work on the theme files to get it to display the way you want. I would suggest finding the code in the theme files and looking for a hook that will allow you to write a custom function for the Platform Base theme. This way you will not have to keep making this change when you update Platform Pro.

Share this post


Link to post
Share on other sites
Sourena

I suggest editing your "functions.php" and adding a hook there. First as Catrina said hide your category and titles using CSS. Then use this hook to add the category and tag titles to the archive pages. Just copy/paste this in your child theme's "functions.php":

/* Adding new category titles. The default category title is hidden using CSS (.current_posts_info). */
	add_action('pagelines_inside_top_theloop','cat_title');
	
		function cat_title(){?>
		 	<?php if (is_category()):?>
	       		<h1 class="pagetitle"><?php echo single_cat_title(); ?></h1>
			<?php endif;
		}
	
	/* Adding new tag titles. The default tag title is hidden using CSS (.current_posts_info). */
	add_action('pagelines_inside_top_theloop','tag_title');
	
		function tag_title(){?>
		 	<?php if (is_tag()):?>
	       		<h1 class="pagetitle"><?php echo single_tag_title(); ?></h1>
			<?php endif;
		}


alefba.us

Web Development & Design for Right-to-Left languages

Share this post


Link to post
Share on other sites
yassad

Hi Sourena, this is the correct answer and it worked for me! I would give you kharma points but it wasn't my original question, so it does not appear to be an option. thank you though. However, I am disappointed that this theme is so limited by the options in the CMS that we have to resort to creating workarounds for what should be such simple tasks for developers. Each workaround takes up precious time. just saying...

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

Sign in to follow this  

×