我可以根据类别或页面更改顶部横幅

Hi all I am new to this community as I am trying to learn php I'm using a wordpress template, and it not has a top banner; I will insert one banner to force that change by category and another by page. But to change the template now in the start mode does not load me the banner but if I load in the categories and the pages. I realized that the index.php calls a series of style:

<?php if (of_get_option('pm_homestyle') == 'widgetized') {  
        get_template_part ('home', 'widgetized');   
    } else {
        get_template_part ('home', 'classic');      
        }?>

And in the head.php

<body <?php if (of_get_option('pm_homestyle') == 'widgetized' ) { body_class(); } else { body_class('classic-blog'); } ?>>

A friend made me this code. This code goes underneath the body This while is in the same head.php

<?php
if(is_page()):
    $banner = get_post_custom_values('banner');
    if(!empty($banner[0])):
     echo "<img src='".$banner[0]."' alt='' />";
    else: 
     echo "<img src='http://localhost/wordpress/images/home.jpg' alt='' />";
    endif;
else:
    $get_cat = get_the_category();
    $cat = $get_cat[0]->slug;
    if(!empty($cat)):
     echo "<img src='http://localhost/wordpress/images/categoria_".$cat.".jpg' alt='' />";
    else: 
     echo "<img src='http://localhost/wordpress/images/home.jpg' alt='' />";
    endif;
endif;
?>

What I want is to add that when you call in the beginning get_template_part ('home', 'widgetized'); the image home.jpg appears; and in the categories or pages them out normal. I have that concern.

the problem is only on the home page could who help me?????