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 image instead of text? « ThemeShaper Forums

ThemeShaper Forums » Power Blog

[closed]

Home link image instead of text?

(7 posts)
  • Started 4 years ago by thibotus01
  • Latest reply from thibotus01
  1. thibotus01
    Member

    Hi,

    In Power Blog child theme.

    That's the function to add a home link in the menu, but instead of text I'd like to replace it by an image. How could i specify this in the function?

    Thanks,

    // 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',
            'exclude' => '2', // Excluding pagess
            'echo' => true
        );
        return $args;
    }
    add_filter('wp_page_menu_args','childtheme_menu_args');
    Posted 4 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
    helgatheviking

    Moderator

    best bet is via CSS...

    set a size for the link and set your image the background-image. then use text-indent: -9999px (something negative and ridiculously large) to basically ensure that it never appears on the screen.

    Posted 4 years ago #
  3. thibotus01
    Member

    Yes but I have to define a class for the home link, and I can't because the code is generated automatically by the function above.

    Posted 4 years ago #
  4. thibotus01
    Member

    Any idea?

    Posted 4 years ago #
  5. thibotus01
    Member

    // Add ID and CLASS attributes to the first <ul> occurence in wp_page_menu
    function thematic_add_menuhomeclass($liclass) {
    	return preg_replace('/ < li > /', '<li class="sf-menu-home">', $liclass, 1);
    } // end thematic_add_menuclass
    add_filter('wp_page_menu','thematic_add_menuhomeclass');

    Is that the suppose to work? (because it doesn't). I took it from the original code for the first UL class.

    Posted 4 years ago #

  6. 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
    em hr

    Moderator

    Try this using an id instead of a class to account for the potential occurrence of the current-page-item class:

    function thematic_add_menuhomeclass($liclass) {
    	return preg_replace('/<li(.*?)>/', '<li id="home" $1>', $liclass, 1);
    } // end thematic_add_menuclass
    add_filter('wp_page_menu','thematic_add_menuhomeclass');

    -Gene

    Posted 4 years ago #
  7. thibotus01
    Member

    Yah it works :) thanks

    Posted 4 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