Code in header randomly appeared
-
Recently installed Freedom them and everything seems to be working fine except at the top of the page it added the words “No categories” It was not originally there until I added some pages and posts. Can anyone help with this issue. site is http://www.envisionprint.net
Thank you!
-
Would need to see your menu loop code (probably in header.php) to take a look at how the menu is generated.
Thanks here it is….
[code removed by mod]
Your code is corrupted slightly as you did not paste between the code tags. Could you edit your post to include the code between the code tags please as it is quite unreadable as plain text.
Looks like your menu is using the new custom menu feature of WordPress 3.0 so just go in there and edit your menu. Looks like the last menu item is not displaying any category information so just delete that menu item.
For more information see here:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> <head profile="http://gmpg.org/xfn/11"> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> <meta name="keywords" content="<?php echo get_option('boldy_keywords'); ?>" /> <meta name="description" content="<?php echo get_option('boldy_description'); ?>" /> <title><?php wp_title('«', true, 'right'); ?> <?php bloginfo('name'); ?></title> <link href="<?php bloginfo('template_directory'); ?>/style.css" rel="stylesheet" type="text/css" /> <link href="<?php bloginfo('template_directory'); ?>/css/ddsmoothmenu.css" rel="stylesheet" type="text/css" /> <link href="<?php bloginfo('template_directory'); ?>/css/prettyPhoto.css" rel="stylesheet" type="text/css" /> <link href="<?php bloginfo('template_directory'); ?>/css/nivo-slider.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery.form.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/ddsmoothmenu.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery.nivo.slider.pack.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery.prettyPhoto.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/custom.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/cufon-yui.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/Museo_Slab_500_400.font.js"></script> <!-- Cufon init --> <script type="text/javascript"> <?php if(get_option('boldy_cufon')!="no"):?> Cufon.replace('h1',{hover: true})('h2',{hover: true})('h3')('.reply',{hover:true})('.more-link'); <?php endif ?> </script> <script type="text/javascript"> $(document).ready(function(){ $('#quickContactForm').ajaxForm(function(data) { if (data==1){ $('#success').fadeIn("slow"); $('#bademail').fadeOut("slow"); $('#badserver').fadeOut("slow"); $('#contact').resetForm(); } else if (data==2){ $('#badserver').fadeIn("slow"); } else if (data==3) { $('#bademail').fadeIn("slow"); } }); }); </script> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> <?php wp_get_archives('type=monthly&format=link'); ?> <?php //comments_popup_script(); // off by default ?> <?php wp_head(); ?> </head> <body <?php if(is_home()){ echo 'id="home"'; }elseif(is_category(get_option('boldy_portfolio')) || post_is_in_descendant_category( get_option('boldy_portfolio')) && !is_single()){ echo 'id="portfolio"'; }?>> <!-- BEGINN MAINWRAPPER --> <div id="mainWrapper"> <!-- BEGIN WRAPPER --> <div id="wrapper"> <!-- BEGIN HEADER --> <div id="header"> <div id="logo"><a href="<?php bloginfo('url'); ?>/"><img src="<?php echo get_option('boldy_logo_img'); ?>" alt="<?php echo get_option('boldy_logo_alt'); ?>" /></a></div> <!-- BEGIN MAIN MENU --> <?php if ( function_exists( 'wp_nav_menu' ) ){ wp_nav_menu( array( 'theme_location' => 'main-menu', 'container_id' => 'mainMenu', 'container_class' => 'ddsmoothmenu', 'fallback_cb'=>'primarymenu') ); }else{ primarymenu(); }?> <!-- END MAIN MENU --> <!-- BEGIN TOP SOCIAL LINKS --> <!-- <div id="topSocial"> <ul> <?php if(get_option('boldy_linkedin_link')!=""){ ?> <li><a href="<?php echo get_option('boldy_linkedin_link'); ?>" class="linkedin" title="Join us on LinkedIn!"><img src="<?php bloginfo('template_directory'); ?>/images/ico_linkedin.png" alt="LinkedIn" /></a></li> <?php }?> <?php if(get_option('boldy_twitter_user')!=""){ ?> <li><a href="http://www.twitter.com/<?php echo get_option('boldy_twitter_user'); ?>" class="twitter" title="Follow Us on Twitter!"><img src="<?php bloginfo('template_directory'); ?>/images/ico_twitter.png" alt="Follow Us on Twitter!" /></a></li> <?php }?> <?php if(get_option('boldy_facebook_link')!=""){ ?> <li><a href="<?php echo get_option('boldy_facebook_link'); ?>" class="twitter" title="Join Us on Facebook!"><img src="<?php bloginfo('template_directory'); ?>/images/ico_facebook.png" alt="Join Us on Facebook!" /></a></li> <?php }?> <li><a href="<?php bloginfo('rss2_url'); ?>" title="RSS" class="rss"><img src="<?php bloginfo('template_directory'); ?>/images/ico_rss.png" alt="Subcribe to Our RSS Feed" /></a></li> </ul> </div> --> <!-- END TOP SOCIAL LINKS --> </div> <!-- END HEADER --> <!-- BEGIN CONTENT --> <div id="content">When I click on Appearance, Menus everything is grayed out. And there are no custom menus. Sorry, not sure what you mean.
OK, from your code, it is using the fall back function primarymenu() in the absence of custom menus. I will need to see this function. You can find it in your themes functions.php file.
[unneeded code removed by mod]
/* CallBack functions for menus in case of earlier than 3.0 WordPress version or if no menu is set yet*/ function primarymenu(){ ?> <div id="mainMenu" class="ddsmoothmenu"> <ul> <?php wp_list_pages('title_li='); ?> <?php wp_list_categories('hide_empty=1&exclude=1&title_li='); ?> </ul> </div> <?php }Just the primarymenu() function would have done! 🙂
OK, you just need to take out the wp_list_categories() line in the primarymenu() function.
Or just create a custom menu in the Appearance->Menus section.
Thanks DGWYER – got it!
Otto is right, from WordPress 3.0 the best method to handle menus is via the new custom menu feature.
wp_list_pagesis still a great function to use, but is only really there as a fall back in case your theme does not support custom menus (you can easily add in support yourself without too much hassle).
The topic ‘Code in header randomly appeared’ is closed to new replies.