My Custom Archive Page Header

Check out the header of this blog. I am using the category image plugin, which is a good one and have been using for years now. I use Genesis theme. Using the below code, I have created this genesis full width header including the image for the category pages.

You can check out any of the category page of this blog, you will find this kind of header and the description.

function archiveHeader() {
    if(is_archive()) {
        if (function_exists('z_taxonomy_image')) {
            $imgurl='';
            $queried_object = get_queried_object();
            $term_id = $queried_object->term_id;
            $imgurl= z_taxonomy_image_url($term_id); 
            if(strlen($imgurl)>=10) {
                echo '<img class="single-featured-image" src="'.$imgurl.'">';
            }
	}
        echo '<div class="container" style="margin-bottom:10px;border-bottom: solid 1px #000;">';
            do_action('kish_archive_desc_title');
        echo '</div>';
    }
}
add_action( 'genesis_before_header', 'archiveHeader' );
remove_action( 'genesis_before_loop', 'genesis_do_taxonomy_title_description', 15 );
add_action( 'kish_archive_desc_title', 'genesis_do_taxonomy_title_description',15 );

Please be sure that you are using the Genesis Framework

Further Reading – Genesis Bootstrap Framework

Another Genesis Theme Hack – Add your Genesis Affiliate Link in the footer

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: