View Single Post
  #1  
Old 10-13-2012, 01:10 PM
theimageworks theimageworks is offline
Registered User
Pro Plus Member
 
Join Date: Oct 2011
Posts: 69
Default Specific H1 dependent on post category

What I would like to do is the following....

If the page is a "post" from the "portfolio" category then I want to override the H1 so its <h1>Portfolio</h1> and not the name of the post.

Likewise if the "post" is from the "blog" category then I want to override the H1 so its <h1>Blog</h1> and not the name of the post.

I'm guessing the answer is to use hooks but could you point me in the right direction please.

Something off the top of my head:

PHP Code:

<?php
if (is_category'portfolio' )){ ?>

remove_action( 'genesis_post_content', 'genesis_post_title' );
add_action('genesis_post_title','customtitle', 0) ;


function customtitle($customtitle) {

    $customtitle = '<h1>Portfolio</h1>';

    return $customtitle;




<?php
} elseif (is_category'blog' ) )){ ?>


remove_action( 'genesis_post_content', 'genesis_post_title' );
add_action('genesis_post_title','customtitle', 0) ;


function customtitle($customtitle) {

    $customtitle = '<h1>Blog</h1>';

    return $customtitle;


<?php
?>
I've had a go and probably made a right mess, so some guidance would be appreciated please. ):