Create New Topic

WordPress Menu

Home Forums Web + Tech Answers WordPress Menu

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #4367

    Parth Ranjan
    Participant

    Hello Bryan Sir

    I want to display home page menu and current menu below main menu, using groundwork theme of wp.

    Example
    Home > Current active page

    Kindly assist me

    Regards
    Parth Ranjan

    #4368

    Bryan Hadaway
    Keymaster

    Ah, I believe you’re referring to breadcrumbs.

    1. Add this to functions.php:

    function groundwork_breadcrumbs()
    {
    if ( !is_home() ) {
    echo '<div id="breadcrumbs"><a href="' . home_url() . '/">' . __( 'Home', 'groundwork' ) . '</a> &rarr; ';
    if ( is_category() || is_single() ) {
    the_category( ', ' );
    if ( is_single() ) {
    echo " &rarr; ";
    the_title();
    }
    } 
    elseif ( is_page() ) { the_title(); }
    elseif ( is_tag() ) { _e( 'Tag Page for ', 'groundwork' ); single_tag_title(); }
    elseif ( is_day() ) { _e( 'Archives for ', 'groundwork' ); the_time( 'F jS, Y' ); }
    elseif ( is_month() ) { _e( 'Archives for ', 'groundwork' ); the_time( 'F, Y' ); }
    elseif ( is_year() ) { _e( 'Archives for ', 'groundwork' ); the_time( 'Y' ); }
    elseif ( is_author() ) { _e( 'Author Archives', 'groundwork' ); }
    elseif ( isset( $_GET['paged'] ) && !empty( $_GET['paged'] ) ) { _e( 'Blog Archives', 'groundwork' ); }
    elseif ( is_search() ) { _e( 'Search Results', 'groundwork' ); }
    elseif ( is_404() ) { _e( 'Page Not Found', 'groundwork' ); }
    echo '</div>';
    }
    }

    2. Add this to header.php, underneath the main menu code:

    <?php { groundwork_breadcrumbs(); } ?>

    #4369

    Parth Ranjan
    Participant

    Thanks Sir, Its working perfectly.

    Regards
    Parth Ranjan, New Delhi

    #4370

    Bryan Hadaway
    Keymaster

    You’re welcome.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.