Strict Standards: Redefining already defined constructor for class bbdb in /home/themes/public_html/forums/bb-includes/db-mysql.php on line 12

Strict Standards: Declaration of BB_Walker_Blank::start_lvl() should be compatible with BB_Walker::start_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_lvl() should be compatible with BB_Walker::end_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::start_el() should be compatible with BB_Walker::start_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_el() should be compatible with BB_Walker::end_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127
Home link in nav not working « ThemeShaper Forums

ThemeShaper Forums » Thematic

[closed]

Home link in nav not working

(5 posts)
  • Started 6 years ago by hoopeys
  • Latest reply from DorinChill
  • This topic is resolved

Tags:

  1. hoopeys
    Member

    Hi there, I'm new to WordPress and Thematic, but liking it a lot so far. I'm struggling with adding the home button to the main navigation bar. I've looked through the tutorials and forum posts on it and it looks like I should have everything I need, but it is still not working. Maybe I missed something... here's the code from my functions.php file in my child theme:

    <?php
    // Adds Home link to navigation
    function sample_menu() {
        $menu = '<div id="menu"><ul>';
        if ( is_home() ) {
            $menu .= '<li class="current_page_item"><a href="';
        }
        else {
             $menu .= '<li><a href="';
        }
        $menu .= get_option('home') . '/" title="Home">Home</a></li>';
        $menu .= str_replace( array( "\r", "\n", "\t" ), '', wp_list_pages('title_li=&sort_column=menu_order&echo=0') );
        $menu .= "</ul></div>\n";
        echo $menu;
    }
    add_filter('globalnav_menu', 'sample_menu' );
    ?>

    Any ideas? Thanks in advance for the help.

    Posted 6 years ago #

  2. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512


    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512
    Anthrax

    Member

    Change
    "add_filter('globalnav_menu', 'sample_menu' ); "
    in
    "add_filter('wp_page_menu', 'sample_menu' ); "

    that works fine !

    Posted 6 years ago #
  3. hoopeys
    Member

    Anthrax - thanks much that added the Home button to the menu. I noticed that when I made the change it removed all stylings for the menu class, because in the functions.php code, the div has id=menu rather than class=menu. I corrected the code and it works great now! Here's the updated code for those interested:

    <?php
    // Adds Home link to navgation
    function sample_menu() {
        $menu = '<div class="menu"><ul>';
        if ( is_home() ) {
            $menu .= '<li class="current_page_item"><a href="';
        }
        else {
             $menu .= '<li><a href="';
        }
        $menu .= get_option('home') . '/" title="Home">Home</a></li>';
        $menu .= str_replace( array( "\r", "\n", "\t" ), '', wp_list_pages('title_li=&sort_column=menu_order&echo=0') );
        $menu .= "</ul></div>\n";
        echo $menu;
    }
    add_filter('wp_page_menu', 'sample_menu' );
    
    ?>
    Posted 6 years ago #

  4. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512


    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512
    Ian Stewart

    Key Master

    I've made an updated solution for this: http://forums.themeshaper.com/topic/how-to-add-a-home-link-to-your-child-theme-menu

    Posted 6 years ago #
  5. DorinChill
    Member

    it works but it ruins its aspect...thei look like a list now...

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.


Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GA_Filter::spool_analytics() should not be called statically in /home/themes/public_html/forums/bb-includes/wp-functions.php on line 586

Strict Standards: Non-static method GA_Filter::spool_this() should not be called statically in /home/themes/public_html/forums/my-plugins/googleanalytics.php on line 183