ThemeShaper Forums » Thematic

[closed]

Add div tags to breadcrumb navigation

(3 posts)
  • Started 7 years ago by Pictrix
  • Latest reply from Gigi
  • This topic is not resolved
  1. Pictrix
    Member

    I'm trying to place the code below between <div></div> tags in order to style it. However, no matter where I place the div tags, they aren't working properly: when I check the "view source" I get the </div> tag at the top of my document and not at at the end of the breadcrumb navigation as it should be. My PHP script, which is otherwise working correctly is:


    <?php
    // ---------- ADD BREADCRUMB NAVIGATION ABOVE CONTAINER
    if (!function_exists('breadcrumb')) {
    function breadcrumb() {
    if ( !is_home() || !is_front_page() ) {
    global $post;
    _e(' ') . bloginfo('name') . _e(' > ');
    if ( is_category() ) {
    single_cat_title();
    //the_category(', ');
    } elseif ( is_single() ) {
    the_category(', ') . _e(' > ') . the_title() . _e('');
    } elseif ( is_page() && $post->post_parent ) {
    _e( get_the_title($post->post_parent) );
    _e(' > ');
    _e( the_title() .'');
    } elseif ( is_page() ) {
    _e( the_title() . '');
    } elseif ( is_search() ) {
    _e('Search in: ') . the_search_query() . _e('');
    }
    }
    }
    }
    ?>
    <?php
    add_action('thematic_abovecontainer','breadcrumb');
    // ---------- END - ADD BREADCRUMB NAVIGATION ABOVE CONTAINER
    ?>

    Any suggestions?

    Posted 7 years ago #
  2. Pictrix
    Member

    I've been playing with this code more an it does not work for Level-3 pages. I've given up and I'll use the NavXT plugin for now. Although I could have placed the NavXT widget in any of the widget areas, I ended up placing it above the container by adding the following script to the functions.php file (full credit is due to Chris):


    <?php
    // ---------- ADD BREADCRUMB NAVIGATION
    function breadcrumb() { ?>
    <div id="breadcrumb">
    <?php if(function_exists('bcn_display')) {
    bcn_display();
    } ?>
    </div>
    <?php
    }
    add_action ('thematic_abovecontainer', 'breadcrumb', 1);
    // ---------- END - ADD BREADCRUMB NAVIGATION
    ?>

    Note that there's a CSS-ready section included in the "Asides, Sidebars & Widget-Ready Areas" in the default.css file --just style away.

    It would be exciting if the next version of Thematic comes with a built-in breadcrumb navigation option... I'll keep my fingers crossed!

    Posted 7 years ago #
  3. Hey Pictrix,
    Not sure if I'm in the right place but I'm trying to add a breadcrumb navigation in the "page top" widget area but need to put it into several custom divs for styling. How might I go about doing that using this code?

    Any help would be greatly appreciated!

    Posted 6 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.