ThemeShaper Forums » Thematic

[closed]

Style home link

(7 posts)
  • Started 3 years ago by retrobou
  • Latest reply from retrobou
  • This topic is not resolved
  1. Hi all, I've added the home link by uncommenting the code in the functions.php in my child theme, but I cannot seem to make the style of the home link match the rest of the sf menu styles...what is the class for the home link that I need to style? It doesn't have a page id. I'm sure its something super simple, but I just can't make it work...can anyone tell me how to style my css to make it match the sf menu link styles? I have each link a different color so this is the css I have used.
    .sf-menu li.Home{
    color:#fff;
    background-color:#4c6f05;
    }
    .sf-menu li.page-item-2 a{
    color:#fff;
    background-color:#395304;
    }
    .sf-menu li.page-item-3 a{
    color:#fff;
    background-color:#66930a;
    }
    .sf-menu li.page-item-4 a{
    color:#fff;
    background-color:#4c6f05;
    }
    .sf-menu li.page-item-5 a{
    color:#fff;
    background-color:#395304;
    }
    .sf-menu li.page-item-6 a{
    color:#fff;
    background-color:#66930a;
    }
    .sf-menu li.page-item-7 a{
    color:#fff;
    background-color:#4c6f05;
    }
    .sf-menu li.page-item-8 a{
    color:#fff;
    background-color:#395304;
    }
    This is the site...
    http://andshedesigns.com/?page_id=2

    Thanks!

    Posted 3 years ago #
  2. what is the code used to make the home link?

    Posted 3 years ago #
  3. This was commented out in my child themes functions.php file, I uncommented it out, the link works, I just can't make it style the way the rest of the links do...

    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');

    ?>
    <?php
    // This will create your widget area
    function my_widgets_init() {
    register_sidebar(array(
    'name' => 'Header Aside',
    'id' => 'header-aside',
    'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">',
    'after_widget' => "",
    'before_title' => "<h3 class=\"widgettitle\">",
    'after_title' => "</h3>\n",
    ));

    }
    add_action( 'init', 'my_widgets_init' );

    // adding the widget area to your child theme
    function my_header_widgets() {
    if ( function_exists('dynamic_sidebar') && is_sidebar_active('header-aside') ) {
    echo '<div id="header-aside" class="aside">'. "\n" . '<ul class="xoxo">' . "\n";
    dynamic_sidebar('header-aside');
    echo '' . "\n" . '</div><!-- #header-aside .aside -->'. "\n";
    }
    }

    ?>
    <?php
    add_action('thematic_header', 'my_header_widgets', 8);

    // Remove default Thematic actions
    function remove_thematic_actions() {
    remove_action('thematic_header','thematic_access',9);
    }
    add_action('init','remove_thematic_actions');

    Posted 3 years ago #
  4. cannobbio
    Member

    The Home link has no class. "Home" is the title of the link not a a class that you can style.
    replace:

    .sf-menu li.Home{
    color:#fff;
    background-color:#4c6f05;
    }

    with:

    .sf-menu a{
    color:#fff;
    background-color:#4c6f05;
    }

    This way all of your menu items will be #4c6f05 by default.

    Posted 3 years ago #
  5. Thanks for the answer, thats my problem...no class to assign just the home link its own style.

    So my design has a different color for each link, I styled all the other links by naming the
    page item number as shown....
    .sf-menu li.page-item-2 a{
    color:#fff;
    background-color:#395304;
    }
    Does that mean I cannot make the home link its own color? My client doesn't want them all the same color...

    Posted 3 years ago #
  6. cannobbio
    Member

    yeah, but your default backgournd-color for menu items is white, if you do:

    .sf-menu a{
    color:#fff;
    background-color:green;
    }

    Your home link will be green, and since the rest have their own color, it will be the only "green". Adding a class to the home link should be easy, but it's easier with just css.

    cya

    Posted 3 years ago #
  7. Ok...thanks...thats what I will have to do :)

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.