ThemeShaper Forums » Thematic

[closed]

Home link on nav bar not showing up

(13 posts)
  • Started 9 years ago by chris_s
  • Latest reply from bskarger
  • This topic is not resolved

Tags:

  1. I have no idea what I'm doing wrong here. I want a Home button on the menu and I have removed the commented parts of the example code in functions.php. A Home button does not show up on the menu bar. Am I missing a step? Such a noob question, but I'm just baffled at this point... I have also used some other snippets from lessons on how to learn to use hooks and filters, and they also don't seem to work. I'm not sure if it's the functions.php or what. I'm using the latest version of Thematic and wordpress 3.0.1

    Chris

    Posted 9 years ago #
  2. Hi - just a quick check and this may be a stupid question:

    Have you already published a page and called it Home?

    Posted 9 years ago #
  3. are you using a custom 3.0 menu? do the other custom pages appear in your menu (ie have you correctly toggled thematic to use the 3.0 menu?). by default thematic uses wp_list_pages() which will never show the home link. there is other code that toggles thematic to wp_page_menu() which can show a home link. where precisely are you failing?

    Posted 9 years ago #
  4. @helgatheviking is right - apologies. Having a Home link in the nav menu isn't necessarily dependent on having a page titled "Home".

    Posted 9 years ago #
  5. I think I really noobed this one. I was originally trying to edit the functions.php file within the admin. Nothing would work while editing in there. So I created a new functions.php file via ftp and did away with the commented out section for the home button at it currently shows a home page. So do I have to create a new php file for everyone I want to customize via ftp instead of editing the child theme files through the admin?

    Also, when I made that Home page change, the css of the nav menu is now vertical and unstyled. Is this supposed to happen? I'm still learning the ropes so I apologize for my ignorance.

    Chris

    Posted 9 years ago #
  6. i would strongly advise that you not edit any files from inside the dashboard. most of the files there are thematic core files which you shouldn't mess with. you will be better served editing a functions.php and a style.css and then FTPing them to your site. MOST files can be editing from your child's functions.php via the extensive hooks and filters of thematic. if you have made extensive changes via the dash i would even suggest reinstalling thematic.

    add this to your CHILD'S functions.php and you will get a home link in your page menu

    function childtheme_menu_args($args) {
    	$args = array(
    		'show_home' => 'Home',
    		'sort_column' => 'menu_order',
    		'menu_class' => 'menu',
    		'echo' => false
    	);
    	return $args;
    }
    add_filter('wp_page_menu_args','childtheme_menu_args');

    http://developing.thematic4you.com/2010/04/breaking-things-to-fix-others/

    according to the above link: if you are using thematic 0.9.7.something you now have to add the echo => false parameter to the menu arguments to get the ul element to have the .sf-menu class, the lack thereof is what caused your menu to go vertical and unstyled.

    Posted 9 years ago #
  7. Thank you so much for the clarification! I'm trying my best to get over this learning curve. It's pretty steep for me...

    edit: did the trick. hopefully this helps someone else out or should be put in the new sample child theme?

    Posted 9 years ago #
  8. dlirious
    Member

    I realize the last bump for this post was 6 months ago, which in web-terms is eons, but I wanted to share my two cents of experience dealing with this issue.

    The code helgatheviking posted is exactly what appears in the child theme functions.php, albeit commented out (and my 'echo' => false was set to 'echo' => true.

    So the different things I tried were:
    -uncommenting the code as it was in the child theme functions.php. This didn't work.
    -changing "true" to "false" in the child theme functions.php. This didn't work either.
    -copying the code from the child theme functions.php to the Thematic theme functions.php, keeping 'echo' => false and being sure to comment out the code in the child theme functions.php so it wouldn't be declared twice. This finally worked. I got the Home button on the navigation bar and it retains all the CSS styles I previously applied to the nav.

    I'm curious why it doesn't work in the child theme functions.php as it should? (Not a PHP code guru here by the way. I know enough to make it do what I want it to do.)

    Posted 8 years ago #
  9. kwight
    Member

    Another option is to simply use custom nav menus under Appearance > Menus (which Thematic will use automatically). Just create the Home button with the Custom Link tool.

    Posted 8 years ago #
  10. 6 months IS eons ago. but i just retested the code i posted above.

    function childtheme_menu_args($args) {
        $args = array(
            'show_home' => 'Home',
            'sort_column' => 'menu_order',
            'menu_class' => 'menu',
            'echo' => false
        );
    	return $args;
    }
    add_filter('wp_page_menu_args','childtheme_menu_args');

    adding the above to my child's functions.php (don't add stuff to thematic's functions.php as this will all be overwritten on any upgrade to thematic core) works perfectly with thematic 0.9.7.8. as kwight mentioned, you could create a custom menu. thematic will auto replace the page menu w/ the custom menu you assign to the Primary location.

    Posted 8 years ago #
  11. Dlirious;
    I'm in the same boat as you. I've tried ALL of the home codes and methods talked about here, but none of them work when placed in my Child Theme. It gives no error, but there's no home button in my navigation. So I did what you said, and put it in the thematic function file instead, and boom, it worked. I'm just confused as to why it won't work in my child theme's file, where it's supposed to be...

    Posted 8 years ago #
  12. do verify that you are using the latest stable release of thematic:
    http://developing.thematic4you.com/thematic-development-release/

    also i you use a custom 3.0 menu then it is easy to add a custom link to Home. the page menu is a bit obsolete at this point.

    Posted 8 years ago #
  13. bskarger
    Member

    Thematic noob here - I've done the same thing, uncommented the function in the child theme's function.php file...and am not seeing the home menu option. This is a fresh install of WP (3.1) and Thematic (0.9.7.7)

    Also, when I use the custom menu, I can certainly get the home menu option to appear, but then I lose 2nd and 3rd level pages (no drop downs). What's up with that?

    Posted 8 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.