Pro Theme Design Forum » Mimbo Pro » Technical Help
Different header for different categories
|
|
I'd like to know if I can change the top header using this snippet: < ? php $category = get_the_category(); echo '<div class="category' . $category[0]->cat_ID . '"> ;? > I saw that in header.php there is another if...else depending on is_ome. Can I integrate my code with the existing one? |
|
|
Hi - I'm not sure what you're asking. Could you be a bit clearer please? |
|
|
Well, I write a worst English... I try to explain: In my website I have lot of categories and I have lot of headers (1 for category). I'd like to mantain this behaviour using your Wordpress theme. Do you kow if this is possible? |
|
I do the same for specific posts and pages and used following code for it in the header.php:
Guess you can apply the same for categories in this way? |
|
Can somebody explain this solution "for real dummies" style? Plz? |
|
" do the same for specific posts and pages and used following code for it in the header.php:" Where exactly in header.php and how do you do that for categories? |
|
|
Check out the Codex section on conditionals. Robin's suggestion is a good one (Robin can you explain where you placed that code?) - you can use conditionals to determine which masthead to correspond with what post by its ID number. |
|
Since wp 2.5 I used arrays instead if more then one page needed the same headerimage, Below i copied in some more code which should make it easier to see were to paste it. Below piece of code is taken directly from header.php (hope it displays well.) I started to copy somewere from line 93. <?php if( get_option( "bm_logo" ) == 1 ) { ?> <?php } if (is_page(array(252,253))) { ?> <?php wp_head(); ?> <body<?php if (is_home()) { ?> id="home"<?php } else { ?> class="page-<?php echo $post->post_name; ?>" id="interior"<?php } ?>> <div id="printMessage"></div> <div id="page"> |
Reply
You must log in to post.
not a support question