ThemeShaper Forums » Thematic

adding home to menu fails

(8 posts)
  • Started 4 years ago by wilhelm
  • Latest reply from wilhelm
  • This topic is resolved
  1. Hi,
    sorry for my bad english and posting again an already answered question!
    I would like to add "home" or "blog" to the menu.
    First I changed "functions.php" (see below), but nothing happened.
    Then I installed "flexi pages" and got home/blog to the sidebar.
    But still not to the menu. Maybe I'm missing something...
    Thanks for your great theme and greetings from Berlin
    Wilhelm - www.schachfieber.de

    // 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 4 years ago #
  2. I tested the code that you pasted and It works for me. Maybe there is something else going on in your functions.php. Post the contents of that file and let's see.

    -Gene

    Posted 4 years ago #
  3. Hi Gene,
    here the full functions.php.
    Further information: I had installed the plugin "page link manager", but deinstalled it (just in case). My static pages are numbered 1,2... When I published a static testpage with number 0 it was showed in first position of the menu.

    <?php
    //
    // Custom Child Theme Functions
    //
    // I've included a "commented out" sample function below that'll add a home link to your menu
    // More ideas can be found on "A Guide To Customizing The Thematic Theme Framework"
    // http://themeshaper.com/thematic-for-wordpress/guide-customizing-thematic-theme-framework
    // 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 4 years ago #
  4. Hi,
    at least my problem is partially solved. I disabled the plugin "flexi pages widget" (which helped for adding "home" to the sidebar) and installed instead the plugin "page lists plus". Doing this I got "home" to the navi and sidebar. Now I will try to change "home" to "blog". But that's another question...
    Anyway, changing "home" to "blog" in function.php is still to no effect. So I leave closing the topic to you.
    Thanks a lot for the nice theme, the forum etc.
    Best wishes
    Wilhelm

    Posted 4 years ago #
  5. Yeah the functions.php code you posted is fine. I'm guessing there is some odd plugin interaction going on for you. I tested your code with flexi pages and page link manager both activated and the "home" link appears in the navigation for me.

    Looking at your site I see Home in the Sidebar and Nav. It looks as if you've solved your problem. What was the conflict?

    Try changing home to blog like this: 'show_home' => 'Blog',

    That function is just filtering the arguments for wp_page_menu() read more about it in the codex the link is in your functions.php.

    Take Care - Gene

    Posted 4 years ago #
  6. Hi Gene!
    Thanks a lot. I did it with "page lists plus" (simply activating 'Home'-page in navi).
    But 'functions.php' is still a problem. Changing into 'show_home'=>'blog' also gives no results.
    I will experiment with some plugins.
    Greetings
    Wilhelm

    Posted 4 years ago #
  7. My only thought on this is that maybe you have thematic as the active theme instead of the child theme... What directory is your edited functions.php in?

    Posted 4 years ago #
  8. Ouch!!! You are right. I didn't follow the readme-text and left the child-theme in the thematic-directory. Very awkward. I'm sorry.

    Now I followed the instruction and have an active thematic-child-theme. Everything is fine. I changed 'functions.php' and got 'Blog' to the menu.

    Finally I deactivated 'Home', created by the plugin. And added 'Blog' to the sidebar. Not so difficult with hindsight.

    Thank you very much, Gene! You would be a very good detective.
    Nice weekend
    Wilhelm

    Posted 4 years ago #

RSS feed for this topic

Reply

You must log in to post.