Home › Forums › Web + Tech Answers › WordPress Menu
Tagged: WordPress Menu
- This topic has 3 replies, 2 voices, and was last updated 4 years, 9 months ago by
Bryan Hadaway.
Viewing 4 posts - 1 through 4 (of 4 total)
-
AuthorPosts
-
April 4th, 2016 at 12:13 PM #4367
Anonymous
InactiveHello Bryan Sir
I want to display home page menu and current menu below main menu, using groundwork theme of wp.
Example
Home > Current active pageKindly assist me
Regards
Parth RanjanApril 4th, 2016 at 5:36 PM #4368Bryan Hadaway
KeymasterAh, 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> → '; if ( is_category() || is_single() ) { the_category( ', ' ); if ( is_single() ) { echo " → "; 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(); } ?>
April 4th, 2016 at 9:21 PM #4369Anonymous
InactiveThanks Sir, Its working perfectly.
Regards
Parth Ranjan, New DelhiApril 5th, 2016 at 2:03 PM #4370Bryan Hadaway
KeymasterYou’re welcome.
-
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.