Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #294

    I’ve set my site up so that the homepage is my “About” page (via WP Admin -> Settings -> Reading -> Front page displays), however now when I go to my About page it doesn’t display the “Additional Headline” custom field or the container around it.

    Settings Screenshot: http://screencast.com/t/ZGE0MzA5Yzk

    So now my site is displaying: http://screencast.com/t/NmZmODQ0O

    Instead of: http://screencast.com/t/Mjc4MDZm

    Does anyone know how I would go about getting this to display?

    #30696

    The problem is that the homepage (pages where the slider is displayed) doesn’t support an additional headline. As you can see here:

    http://www.kriesi.at/themes/avisio/

    the front page (homepage) doesn’t display the breadcrumb menu and the additional headline you’re searching for. You can edit the index.php to implement the breadcrumb menu and the additional headline, though.

    The Dude

    #30697

    It is possible to add the headline to the front page however there is a bit of theme editing to do.

    Open up header.php and right at the end you’ll find this code:

    #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>';
    }

    Breadcrumbs and headlines are set up in this function, and are set to not display on the homepage.

    You can add this code to set the $headline variable correctly for the homepage directly under the code in header.php:

    if(is_front_page()){
    $headline = get_post_meta($post->ID, "_headline", true);
    if($headline != "") $headline = '<h2>'.$headline.'</h2>';
    }

    and use this code where you’d like the Headline to display in index.php:

    if($headline != "") echo $headline;

    Hope this helps, let me know if you need further clarification.

    #30698

    Hello, I need help with my breadcrumb. I set the home page to be my blog page. Text appears just fine in the breadcrumb in all the other pages, but is blank in the homepage. I would like to be able to put my own text in my homepage breadcrumb area. I’m confused with what was posted here, so if you could please let me know how to edit the homepage breadcrumb I would really appreciate it. I’m using the Twicet 5 theme. Here is my breadcrumb code.

    <?php

    class simple_breadcrumb{

    var $options;

    function simple_breadcrumb(){

    $this->options = array( //change this array if you want another output scheme

    ‘before’ => ‘<span> ‘,

    ‘after’ => ‘ </span>’,

    ‘delimiter’ => ‘»’

    );

    $markup = $this->options.$this->options.$this->options;

    global $post;

    echo ‘<p class=”breadcrumb”><span class=”breadcrumb_info”>You are here:</span> ‘;

    bloginfo(‘name’);

    echo ““;

    if(!is_front_page()){echo $markup;}

    $output = $this->simple_breadcrumb_case($post);

    echo “<span class=’current_crumb’>”;

    if ( is_page() || is_single()) {

    the_title();

    }else{

    echo $output;

    }

    echo ” </span></p>”;

    }

    function simple_breadcrumb_case($der_post){

    $markup = $this->options.$this->options.$this->options;

    if (is_page()){

    if($der_post->post_parent) {

    $my_query = get_post($der_post->post_parent);

    $this->simple_breadcrumb_case($my_query);

    $link = ‘<a href=”‘;

    $link .= get_permalink($my_query->ID);

    $link .= ‘”>’;

    $link .= ”. get_the_title($my_query->ID) . ”. $markup;

    echo $link;

    }

    return;

    }

    if(is_single()){

    $category = get_the_category();

    if (is_attachment()){

    $my_query = get_post($der_post->post_parent);

    $category = get_the_category($my_query->ID);

    $ID = $category[0]->cat_ID;

    echo get_category_parents($ID, TRUE, $markup, FALSE );

    previous_post_link(“%link $markup”);

    }else{

    $ID = $category[0]->cat_ID;

    echo get_category_parents($ID, TRUE, $markup, FALSE );

    }

    return;

    }

    if(is_category()){

    $category = get_the_category();

    $i = $category[0]->cat_ID;

    $parent = $category[0]-> category_parent;

    if($parent > 0 && $category[0]->cat_name == single_cat_title(“”, false)){

    echo get_category_parents($parent, TRUE, $markup, FALSE);

    }

    return single_cat_title(”,FALSE);

    }

    if(is_author()){

    $curauth = get_userdatabylogin(get_query_var(‘author_name’));

    return “Author: “.$curauth->nickname;

    }

    if(is_tag()){ return “Tag: “.single_tag_title(”,FALSE); }

    if(is_404()){ return “404 – Page not Found”; }

    if(is_search()){ return “Search”; }

    if(is_year()){ return get_the_time(‘Y’); }

    if(is_month()){

    $k_year = get_the_time(‘Y’);

    echo ““.$k_year.”“.$markup;

    return get_the_time(‘F’); }

    if(is_day() || is_time()){

    $k_year = get_the_time(‘Y’);

    $k_month = get_the_time(‘m’);

    $k_month_display = get_the_time(‘F’);

    echo ““.$k_year.”“.$markup;

    echo ““.$k_month_display.”“.$markup;

    return get_the_time(‘jS (l)’); }

    }

    }

    ?>

    #30699

    The answer posted above your post was to do with the headlines not the breadcrumbs.

    The reason the breadcrumbs don’t work is the page is the front page. In header.php there is conditional code to display the breadcrumbs only if you’re not on the front page but this didn’t take into account changing the front page to the blog layout.

    To add your own text here, open up header.php and find this code:

    <?php if(!is_front_page() && (class_exists('simple_breadcrumb'))){ $bc = new simple_breadcrumb; }?>

    Change it to:

    <?php if(!is_front_page() && (class_exists(‘simple_breadcrumb’))){ $bc = new simple_breadcrumb; } else { ?>`

    <p class=”breadcrumb”>YOUR TEXT HERE</p>

    <?php } ?>`

    replacing YOUR TEXT HERE with the text you want to display.

    #30700

    Worked like a charm. Thank you very much for the help.

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘How do you add the "Additional Headline" to the front page?’ is closed to new replies.