How difficult would it be to modify the theme to display the additional heading DIV on selective pages. That is, can I use it on some pages and not others. For example, I'd like to keep the strip at the top of the portfolio to utilize the sort functions, but on most pages I could do without it. Any help would be appreciated.
Selective Use of the "Additional Heading" Space
8 posts from 4 voices-
Posted 2 years ago #
-
Hey,
the additional header is created by following code in header.php:
<?php #breadcrumb navigation if(!is_front_page()){ if($k_option['custom']['headlineContent'] == '') { $headline = get_post_meta($post->ID, "_headline", true); if($headline != "") $headline = '<h2>'.$headline.'</h2>'; } else { $headline = $k_option['custom']['headlineContent']; } echo '<div class="wrapper wrapper_heading ie6fix" id="wrapper_featured_area">'; echo '<div class="overlay_top ie6fix"></div>'; echo '<div class="overlay_bottom ie6fix">'; echo '</div>'; echo '<div class="center">'; if($headline != "") echo $headline; echo '</div></div>'; echo '<div class="wrapper" id="wrapper_stripe">'; if(class_exists('kclass_breadcrumb')){ $bc = new kclass_breadcrumb; } echo '</div>'; } ?>You can use post meta, etc. to exlude/include the output on an individual basis.
Posted 2 years ago # -
Messing around last night I came up with something that works, but wouldn't be nearly as clean as what you are proposing.
So if I need to exclude a page with an ID of 2, how would I amend the above code. I'm getting an error an undefined method error, so I am obviously wrong in my placement.
Appreciate the help.
Posted 2 years ago # -
Hey,
Firstly if you're getting errors I'd recommend starting with a fresh copy of the template files.
The code Dude posted above tells the page to show the content on any page except the front page / home page because of this code:
if ( !is_front_page() ) {This can be modified to not show up on other pages or you can use the code elsewhere in the code to further customise which code will show up on certain pages.
For example, to stop the breadcrumbs showing up on a page called about, you could use this code:
<?php #breadcrumb navigation if(!is_front_page()){ if($k_option['custom']['headlineContent'] == '') { $headline = get_post_meta($post->ID, "_headline", true); if($headline != "") $headline = '<h2>'.$headline.'</h2>'; } else { $headline = $k_option['custom']['headlineContent']; } echo '<div class="wrapper wrapper_heading ie6fix" id="wrapper_featured_area">'; echo '<div class="overlay_top ie6fix"></div>'; echo '<div class="overlay_bottom ie6fix">'; echo '</div>'; echo '<div class="center">'; if($headline != "") echo $headline; echo '</div></div>'; echo '<div class="wrapper" id="wrapper_stripe">'; if(!is_page('about')){ if(class_exists('kclass_breadcrumb')){ $bc = new kclass_breadcrumb; } } echo '</div>'; } ?>You can get a full list of template tags from the Conditional Tags page in the WordPress Codex.
Hope this helps!
James
Posted 2 years ago # -
Dude, you can close this one out. Custom fields did the trick.
Posted 2 years ago # -
Hey,
Awesome, glad to hear you've got this working as you want.
Let us know if you have any other questions.
James
Posted 2 years ago # -
What can I modify to just turn off the headline everywhere? That big white stripe is just awful looking.
here is what I'm talking about: http://kprotopapas.com/?page_id=46
Posted 1 year ago # -
Hey,
add following code to style.css:
#wrapper_featured_area{ display: none !important; }Posted 1 year ago #
Reply
You must log in to post.














