ThemeShaper Forums » Thematic

[closed]

How to add a home link to your Child Theme menu

(9 posts)
  • Started 14 years ago by Ian Stewart
  • Latest reply from em hr
  • This topic is not a support question
  1. Here's an easy code snippet you can just pop into your Child Theme functions.php:

    // Add a home link to your menu
    function childtheme_menu_args($args) {
        $args = array(
            'show_home' => 'Home',
            'sort_column' => 'menu_order',
            'menu_class' => 'menu',
            'echo' => true
        );
        return $args;
    }
    add_filter('wp_page_menu_args','childtheme_menu_args');

    If you want some more ideas on what you can add to your menu check out the codex page on wp_page_menu.

    Posted 14 years ago #
  2. harun
    Member

    worked like a charm! how can i get the home link to show up in my Pages list which i have sitting in 1st sub aside?

    Posted 14 years ago #
  3. You can use Flexi Pages Widget.

    Cheers,

    Chris

    Posted 14 years ago #
  4. harun
    Member

    pretty cool plugin. but list is now horizontal and has a white background. more than i want to do. just want to add one more bullet in my Pages list for Home at the top of the list.

    regards
    harun

    Posted 14 years ago #
  5. WordPress' Pages plugin uses wp_page_list(). This function has no option to add a 'home' link. Therefore you have only three options: rewrite the widget, write a jQuery script to implement the 'home' link or use a different widget.

    Cheers,

    Chris

    Posted 14 years ago #
  6. harun
    Member

    gotcha. lemme give it a think. might just do something lazy like write a home link in footer

    regards
    harun

    Posted 14 years ago #
  7. istik
    Member

    I commented out on functions.php in my child theme that would put a home link in my menu but still it does not appear. I am new to this so please bear with me.

    // Adds a home link to your menu
    // http://codex.wordpress.org/Template_Tags/wp_page_menu
    function childtheme_menu_args($args) {
        $args = array(
            'show_home' => 'Home',
            'sort_column' => 'menu_order',
            'menu_class' => 'menu',
            'echo' => true
        );
    	return $args;
    }
    add_filter('wp_page_menu_args','childtheme_menu_args');
    Posted 12 years ago #
  8. Hi there - second time I've linked to Helga's tutorial in as many minutes! Try here:

    http://forums.themeshaper.com/topic/thematic-menus-demystified-1

    And scroll down to No.2

    Posted 12 years ago #
  9. There is a bug in Thematic 0.9.7.6 that is causing this it has been fixed in trunk and is on track for the next release. In the meantime add a priority of 20 to the add_filter like so

    add_filter('wp_page_menu_args','childtheme_menu_args', 20);
    Posted 12 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.