place "home" link in navigation/menu bar
-
Hi!
I’ve been trying to figure out how to place a “home” link in my navigation/menu, but I can’t figure it out. My header.php seems to be written differently compared to most themes.
I know you can make a page that is titled “home” and it will show up in the navigation bar, but I wanted a link that would take the reader back to the home page.
Just in case:
my header.php code: https://pastebin.com/RiRxy6tw
my website: https://www.audreydao.com
My theme is called BFA Round Tabs 1.10 by BytesforallI did go onto the Bytesforall forum for help, but no one seemed to have my problem.
Any help will be greatly appreciated. Thank you!
-
Your template has a ‘home’ link on every single page. A web standart is to have it “embedded” on the blog/site name and/or logo.
I navigated on your site and was able to return to the index by clicking on your logo, try it yourself:
I noticed that, but I’m afraid people won’t know to click on my logo/name to return home. So I was just thinking of adding a noticeable home link in my navigation.
Thank you for responding!
Can you paste your header.php code here?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="https://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> <head profile="https://gmpg.org/xfn/11"> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> <?php global $options; foreach ($options as $value) { if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); } } ?> <title><?php // TITLE TAG for ALL Pages // If you don't want the Blog Name added to certain types of pages (could make sense for single post and "page" pages, to make them more unique), // remove the 'echo " « "; bloginfo('name');' part (the first and last quotation mark are just for highlighting the text part, they don't appear below) // in the corresponding line below: if ( is_home() ) {bloginfo('name'); /* If home page, use Blog Name */ } elseif ( is_single () OR is_page () ) { the_title(); echo " « "; bloginfo('name'); /* If single post page or "page" page, use post title / page title, followed by blog name */} elseif ( is_category() ) { single_cat_title(); echo " « "; bloginfo('name'); /* If category page, use categroy title, followed by blog name */ } elseif ( function_exists('is_tag') && is_tag() ) { single_tag_title(); echo " « "; bloginfo('name'); /* If tag page, use tag title, followed by blog name */ } elseif ( is_search() ) { echo wp_specialchars($s); echo " « "; bloginfo('name'); /* If search result page, use search query, followed by blog name */ } elseif ( is_day () ) { the_time('l, F jS, Y'); echo " « "; bloginfo('name'); /* If daily archive, use day date, followed by blog name */ } elseif ( is_month () ) { the_time('F Y'); echo " « "; bloginfo('name'); /* If monthly archive, use month date, followed by blog name */ } elseif ( is_year () ) { the_time('Y'); echo " « "; bloginfo('name'); /* If yearly archive, use year date, followed by blog name */ } elseif ( is_author () ) { the_author(); echo " « "; bloginfo('name'); /* If author page, use author name, followed by blog name */ } elseif ( is_404 () ) { echo "404 not found « "; bloginfo('name'); /* If 404 not found page, use "404 not found", followed by blog name */ } else { wp_title(); } ?> </title> <?php // META DESCRIPTION Tag for (only) the HOMEPAGE. To be set in WP Admin -> Presentation -> BytesForAll Theme Options if ( is_home() && rtrim($brt_homepage_meta_description) != "" ) { echo "<meta name=\"description\" content=\"$brt_homepage_meta_description\">\n"; } ?> <?php // META KEYWORDS Tag for (only) the HOMEPAGE. To be set in WP Admin -> Presentation -> BytesForAll Theme Options if ( is_home() && rtrim($brt_homepage_meta_keywords) != "" ) { echo "<meta name=\"keywords\" content=\"$brt_homepage_meta_keywords\">\n"; } ?> <?php // META DESCRIPTION Tag for SINGLE POST PAGES & "PAGE" PAGES if ( have_posts() && (is_single() OR is_page() ) && !is_home() ) : ?> <?php echo "<meta name=\"description\" content=\""; ?> <?php while ( have_posts() ) : the_post(); if (get_the_excerpt()) { $description = get_the_excerpt(); } endwhile; $finaldescription = ""; $shorteneddescription = (explode(" ", $description, 26)); // change this number to max amount of words - 1 if (count($shorteneddescription) > 25) { // change this number to max amount of words $lastinphrase = array_pop($shorteneddescription); } while (list(, $word) = each($shorteneddescription)) { $finaldescription .= ("$word "); } $finaldescription = rtrim ($finaldescription); echo "$finaldescription"." ...\" />\n"; ?> <?php endif; ?> <?php // META KEYWORDS Tag for ALL pages CONTAINING POSTS, EXCEPT HOMEPAGE (Note: "PAGE" PAGES don't have posts in the sense meant here, so no keywords for them) if ( have_posts() && !is_page() && !is_home() ) : ?> <?php echo "<meta name=\"keywords\" content=\""; ?> <?php while ( have_posts() ) : the_post(); ?> <?php if (function_exists('get_the_tags') && get_the_tags()) { $posttags = get_the_tags(); if ($posttags) { foreach($posttags as $tag) { $keyword_array[] = $tag->name; }}} if (get_the_category()) { $postcategory = get_the_category(); if ($postcategory) { foreach($postcategory as $category) { $keyword_array[] = $category->name; }}} ?> <?php endwhile; ?> <?php $keywords_unique = array_unique($keyword_array); while (list(, $number) = each($keywords_unique)) { $keywords .= strtolower("$number, "); } $keywords = rtrim ($keywords, ", "); echo "$keywords\" />\n"; ?> <?php endif; /* END META KEYWORDS */ ?> <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats --> <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" /> <style type="text/css"> body {background-color: <?php echo $brt_body_backgroundcolor; ?>; color: <?php echo $brt_body_color; ?>; margin: <?php echo $brt_body_margin_topbottom; ?>px 0; } a:link, a:visited, a:active {color: <?php echo $brt_link_color; ?>; text-decoration: none; text-align: center; /*needed for IE page align*/} a:hover {text-decoration: underline; } h3.widgettitle {color: <?php echo $brt_sidebar_headings_font_color; ?>; width: 100%; font-size: 1.3em; margin-bottom: 0px; padding-bottom: 0px; font-family: <?php echo $brt_body_font; ?>; border-bottom: <?php echo $brt_sidebar_headings_underline_width; ?>px dashed <?php echo $brt_sidebar_headings_underline_color; ?>; } p.header { /*clear:left;*/ float:left; text-align: center; /*width: 49%*/; font-size:1.2em; font-weight: bold; line-height:1.2em; margin:<?php echo $brt_blog_tagline_margin_top; ?>px 0 <?php echo $brt_blog_tagline_margin_bottom; ?>px 0; padding:0; color: <?php echo $brt_blog_tagline_color; ?>; } .inside h1{ font-family: <?php echo $brt_blog_title_font; ?>; letter-spacing:-1px; line-height: 1.0em; font-size:<?php echo $brt_blog_title_fontsize; ?>em; float:left; /*width: 49%;*/ margin: <?php echo $brt_blog_title_margin_top; ?>px 50px 0 0; padding:0; } a.header:link, a.header:visited, a.header:active, a.header:hover {color: <?php echo $brt_blog_title_color; ?>; text-decoration: none; } #page-container {background-color: #fff; border: solid <?php echo $brt_border_around_entire_layout; ?>px <?php echo $brt_bordercolor_around_entire_layout; ?>; width: <?php echo $brt_page_width; ?>px; margin-left:auto; margin-right: auto; font-family: <?php echo $brt_body_font; ?>; text-align: left; /* because we set body to center for IE */} #outer-column-container {border-left: solid <?php echo $brt_leftcolumn_width; ?>em <?php echo $brt_leftcolumn_backgroundcolor; ?>; border-right: solid <?php echo $brt_rightcolumn_width; ?>em <?php echo $brt_rightcolumn_backgroundcolor; ?>;} #left-column {float: left; margin-left: -<?php echo $brt_leftcolumn_width; ?>em; width: <?php echo $brt_leftcolumn_width; ?>em; margin-right: 1px; } #right-column {float: right; margin-right: -<?php echo $brt_rightcolumn_width; ?>em; width: <?php echo $brt_rightcolumn_width; ?>em; margin-left: 1px; } #masthead {background-color: #ffffff; border-top: <?php echo $brt_header_inner_topborder_width; ?>px solid <?php echo $brt_header_inner_topborder_color; ?>; padding-top: 1px; border-bottom: solid <?php echo $brt_header_bottomborder_width; ?>px <?php echo $brt_header_bottomborder_color; ?>;} #footer {background-color: <?php echo $brt_footer_backgroundcolor; ?>; border-top: solid <?php echo $brt_footer_topborder_width; ?>px <?php echo $brt_footer_topborder_color; ?>; padding-bottom: 1px;} #inner-column-container {border: dashed <?php echo $brt_middlecolumn_borderwidth_leftright; ?>px <?php echo $brt_middlecolumn_bordercolor_leftright; ?>; border-width: 0 <?php echo $brt_middlecolumn_borderwidth_leftright; ?>px; margin: 0 -<?php echo $brt_middlecolumn_borderwidth_leftright; ?>px;} #inner-column-container {background-color: <?php echo $brt_middlecolumn_backgroundcolor; ?>;} /*URL: https://www.dynamicdrive.com/style/ */ #ddcolortabs a{ float:left; color: <?php echo $brt_colortabs_font_color; ?>; background: <?php echo $brt_colortabs_default_color; ?> url(<?php echo get_bloginfo('template_directory'); ?>/images/color_tabs_left.gif) no-repeat left top; margin:0 4px 0 0; padding:0 0 1px 3px; text-decoration:none; letter-spacing: 1px;} #ddcolortabs a span{ float:left; display:block; background: transparent url(<?php echo get_bloginfo('template_directory'); ?>/images/color_tabs_right.gif) no-repeat right top; padding:4px 9px 2px 6px; } #ddcolortabs a:hover{ background-color: <?php echo $brt_colortabs_hover_color; ?>;} #ddcolortabs a:hover span{ background-color: <?php echo $brt_colortabs_hover_color; ?>;} #ddcolortabs #current a:link, #ddcolortabs #current a:active, #ddcolortabs #current a:visited, #ddcolortabs #current a:hover, #ddcolortabs #current span{ background-color: <?php echo $brt_colortabs_current_color; ?>;} #ddcolortabsline{ clear: both; padding: 0; width: 100%; height: <?php echo $brt_header_inner_bottomborder_width; ?>px; line-height: <?php echo $brt_header_inner_bottomborder_width; ?>px; background: <?php echo $brt_header_inner_bottomborder_color; ?>; /*border-top: 1px solid #fff;*/ /*Remove this to remove border between bar and tabs*/} #modernbricksmenu{padding: 0; width: auto; background: transparent; voice-family: "\"}\""; voice-family: inherit;} #modernbricksmenu ul{font: bold 11px Arial; margin:0; margin-left: 10px; <?php /*margin between first menu item and left browser edge*/ ?> padding: 0; list-style: none;} #modernbricksmenu li{display: inline; margin: 0 2px 0 0; padding: 0; text-transform:uppercase; } #modernbricksmenu li:first-child {margin-left: 1px; } #modernbricksmenu a{float: left; display: block; color: <?php echo $brt_colortabs_font_color; ?>; margin: 0 10px 0 0; <?php /*Margin between each menu item*/ ?> padding: 5px 10px; text-decoration: none; letter-spacing: 1px;background-color: <?php echo $brt_colortabs_default_color; ?>; /*border-bottom: 1px solid white; */ } #modernbricksmenu a:hover{background-color: <?php echo $brt_colortabs_hover_color; ?>; } #modernbricksmenu #current a{ background-color: <?php echo $brt_colortabs_current_color; ?>; border-color: <?php echo $brt_colortabs_current_color; ?>; } #modernbricksmenuline{ clear: both; padding: 0; width: 100%; height: <?php echo $brt_header_inner_bottomborder_width; ?>px; <?php /*line-height: 15px;*/ /*line-height causes errors in IE with this menu*/ ?> background: <?php echo $brt_header_inner_bottomborder_color; ?>; } /**********************************************************/ <?php #set page sub sub pages back so they don't get highlighted as well: ?> li.current_page_item li a:link, li.current_page_item li a:active, li.current_page_item li a:visited, li.current_page_item li a:hover {color:<?php echo $brt_link_color; ?>; font-weight: normal; } .inside {margin: 15px; } #footer .inside{text-align: center;} .postmetadata {clear:both} </style> <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" /> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> <?php wp_head(); ?> </head> <body> <div id="page-container"> <div id="masthead"> <div class="inside"> <?php if ($brt_show_header_searchbox == "Yes") { ?><div style="float: right; margin: 0px 0 0 0;"> <?php include (TEMPLATEPATH . '/searchform.php'); ?> </div><?php } ?> <a href="https://www.audreydao.com"><img src="https://i26.photobucket.com/albums/c104/ba_lan/Headergray100withtitle.jpg" border="0" alt="Photobucket"></a> <div style="clear:both"></div> </div> <?php $chosen_menu_type = "ddcolortabs"; ?> <?php if ($chosen_menu_type == "ddcolortabs") { ?> <div class="clearfix" id="ddcolortabs"> <ul><?php $string = wp_list_pages('title_li=&echo=0&depth=1' ); $pattern2 = ' current_page_item "'; $replacement2 = '" id="current"'; $string = str_replace($pattern2, $replacement2, $string); $pattern = '/<a href(.*)>(.*)<\/a>/U'; $replacement = '<a href$1><span>$2</span></a>'; echo preg_replace($pattern, $replacement, $string);?></ul></div><div id="ddcolortabsline"> </div> <?php } ?> <?php if ($chosen_menu_type == "modernbricks") { ?> <div class="clearfix" id="modernbricksmenu"> <ul><?php $string = wp_list_pages('title_li=&echo=0&depth=1' ); $pattern = ' current_page_item "'; $replacement = '" id="current"'; echo str_replace($pattern, $replacement, $string); ?></ul></div><div id="modernbricksmenuline"> </div> <?php } ?> <?php if (function_exists('pixopoint_menu')) {pixopoint_menu();} ?> </div>
Sorry, i’m not able to help you. You header really is very diferent from all the templates I’ve seen. Good Luck.
yeah. if it was like the coding as most types of headers then i wouldn’t have so much trouble figuring it out. But thank you though. I really appreciate you trying.
- The topic ‘place "home" link in navigation/menu bar’ is closed to new replies.