Border of menu item "About" not visible upon startup

Home Forums WordPress Theme Babatox – Responsive Landing Page WP Theme Border of menu item "About" not visible upon startup

This topic contains 6 replies, has 2 voices, and was last updated by  CTHthemes 2 years, 1 month ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #5282

    Aerdvark
    Participant

    Support Expired

    If I open the demo site: http://demowp.cththemes.net/babatox/home-alt2/ the “About” button has no visible border, if I click “Team” (or any other menu item) and then click “About” then it does display the border, even after I scroll up to the top of the page.

    I would like the “About” button to have the border visible upon startup. Also the word “about” should be red. So the menu will always and at any time have at least one menu item with a border and red letters. In my case I do not use the space above the #ABOUT section.

    Maybe this is is the part where to edit but it gives me all the menu items with a border:

    .navbar-inverse .navbar-nav > li > a, .navbar-inverse .navbar-nav > li > a:focus, .navbar-inverse .navbar-nav > li > a:active {
        font-size: 12px;
        line-height: 18px;
        color: #EFF3F4;
        padding: 6px 10px;
        margin: 0px;
        outline: medium none;
        <strong>border: 2px solid rgba(255, 255, 255, 0)</strong>;
        border-radius: 40px;
    Attachments:
    You must be logged in to view attached files.
    #5634

    Aerdvark
    Participant

    Support Expired

    Hello CTH Themes,

    My question is still open, can you pease assist?
    Thank you.

    #5654

    CTHthemes
    Keymaster

    Hi, please send me your link the I will help. Thank you.

    #5659

    Aerdvark
    Participant

    Support Expired

    Thanks in advance! My temp site location: http://tinyurl.com/ht4go56

    #5690

    CTHthemes
    Keymaster

    Hi, please try add the code bellow to theme functions.php file, after babatox_script_ie function: http://prntscr.com/9qfmq9

    /**
     * Modify menu link class attribute
     *
     * @since Babatox 2.0
     */
    add_filter('nav_menu_css_class', 'babatox_nav_menu_css_class_func', 10, 2);
    
    $babatox_menu_link_class = array();
    
    function babatox_nav_menu_css_class_func($classes, $item) {
        global $babatox_menu_link_class;
        $babatox_menu_link_class = array();
        $selected_menu = array_search("selected", $classes);
        if ($selected_menu !== false) {
            $babatox_menu_link_class[] = 'selected';
        }
        return $classes;
    }
    
    add_filter('nav_menu_link_attributes', 'babatox_nav_menu_link_attributes_func', 10, 3);
    
    function babatox_nav_menu_link_attributes_func($atts, $item, $args) {
        global $babatox_menu_link_class;
        if (!empty($babatox_menu_link_class)) {
            $atts['class'] = implode(" ", $babatox_menu_link_class);
        }
        
        return $atts;
    }
    

    then add ‘selected’ class to your home menu item: http://prntscr.com/9qfo0k

    Thanks.

    #5702

    Aerdvark
    Participant

    Support Expired

    It seems to work, but I have copied the code into the child theme fie functions.php. I think it is better that way in case of any updates of the babtox core files.

    Thanks for the help.

    #5704

    CTHthemes
    Keymaster

    Yes, it’s right.:)

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.