Eureka! Custom Header API Enlightenment

For the longest time, I’ve been struggling with the WordPress Custom Header API. I wanted to use it in my next theme, but was getting some wierd behavior, and it was screwing up a snippet that I use in the header that renders the right heading tag for the right page, and the headerimg is an <h1> tag on the front page only.  The post titles on the front page are <h2>. I use <h1> tags for top level pages, single post pages, and <h2> tags for archives, category pages and the like.   I use the above code to make sure the semantics were right.

I wish they’d made it a bit more flexible. it would be nice to upload both a background to the header div AND replace the headerimg div lext wtih a logo. And leave the description part alone, electing to hide it separately.

I am sure that all this can and will be soon accomplished by a WordPress geek soon! Just don’t expect it to be me! :D

So, I elected to trash the idea of custom image header in the next theme. What I am going to start doing though, is opening both support forums and making videos of how to do these manually,

Here’s my code I couldn’t bear to part with: goes in header.php, replacing everything in the <headerimg> its ending </div> tag.

<?php if (is_front_page()) { ?>
<h1><a href=”<?php echo get_option(‘home’); ?>/” title=”<?php bloginfo(‘name’); ?>”><?php bloginfo(‘name’); ?></a></h1>

<?php } else { ?>
<a href=”<?php echo get_option(‘home’); ?>/” title=”<?php bloginfo(‘name’); ?>”><?php bloginfo(‘name’); ?></a>

<?php } ?>

So, production on the promised theme shall begin again soon!

Good morning, world!

Related Posts

  • No Related Post

2 Responses to “Eureka! Custom Header API Enlightenment”

  1. Leeah

    Hello! I have a question about your blog theme blossom, & I didn’t seem to find an answer in the forums. Could you please email me regarding how I can just simply remove the default mainmenu with this template? I’d really appreciate it!!

    Great theme by the way :)

  2. Web Wench

    I can’t post the changes you’ll need to make in this comment box (at least I don’t think I can) so please start a forum topic, which I can format the code as it should be.

    I can tell you here that you would have to take out the entire topmenu div from header.php and also remove the entire absnav div from the footer.

    That’s remembering off the top of my head how I coded it and what I called the absnav div – it’s the one with the wp page in it in footer.php.

Leave a Reply




:D :-) :( :o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: