New Landing How can we help? Themeforest Theme Support Dante Use Icons in Footer menu

Viewing 2 posts - 1 through 2 (of 2 total)
  • Posted in: Dante
  • #106484
    No Dinx
    Member
    Post count: 25

    Hey there, Running the latest versions of WP and Dante. I already modified footer.php to display icons in the footer menu by adding in the line here:

    $footer_menu_args = array(
    'echo'            => true,
    'theme_location' => 'footer_menu',
    'walker' => new sf_mega_menu_walker,
    'fallback_cb' => ''
    );
    wp_nav_menu( $footer_menu_args );

    Now what I want is for the footer menu to only contain those icons as the link, and no other text.

    I can’t figure out how to modify this bit in the child theme functions.php…

    class sf_mega_menu_walker extends Walker_Nav_Menu {
    
    function start_el(&$output, $item, $depth = 0, $args = array(), $current_object_id = 0) {
    
    global $wp_query;
    $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
    
    $class_names = $value = '';
    
    $classes = empty( $item->classes ) ? array() : (array) $item->classes;
    
    $natural_width = empty( $item->isnaturalwidth ) ? "" : "sf-mega-menu-natural-width";
    $alt_style = empty( $item->altstyle ) ? "" : "sf-mega-menu-alt";
    $hideheadings = empty( $item->hideheadings ) ? "" : "no-headings";
    $nocolumnspacing = empty( $item->nocolumnspacing ) ? "" : "no-column-spacing";
    $menu_width = empty( $item->menuwidth ) ? "" : 'style="width: '.$item->menuwidth.'px;"';
    
    $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );
    $class_names = ' class="menu-item-'. $item->ID . ' '. esc_attr( $class_names ) . ' '.$natural_width.' '.$alt_style.' '.$hideheadings.' '.$nocolumnspacing.'" '.$menu_width;
    
    $output .= $indent . '<li ' . $value . $class_names .'>';
    
    $attributes  = ! empty( $item->attr_title ) ? ' title="'  . esc_attr( $item->attr_title ) .'"' : '';
    $attributes .= ! empty( $item->target )     ? ' target="' . esc_attr( $item->target     ) .'"' : '';
    $attributes .= ! empty( $item->xfn )        ? ' rel="'    . esc_attr( $item->xfn        ) .'"' : '';
    $attributes .= ! empty( $item->url )        ? ' href="'   . esc_attr( $item->url        ) .'"' : '';
    
    $prepend = '';
    $append = '<span class="nav-line"></span>';
    
    $description  = ! empty( $item->description ) ? '<span>'.esc_attr( $item->description ).'</span>' : '';
    
    if ($depth != 0) {
    $description = $append = $prepend = "";
    }	
    
    if (!empty( $item->megatitle )) {
    $item_output = $args->before;
    $item_output .= '<span class="title">';
    if (!empty( $item->menuicon )) {
    $item_output .= '<i class="'.$item->menuicon.'"></i>';
    }
    $item_output .= $args->link_before .$prepend.apply_filters( 'the_title', $item->title, $item->ID ).$append;
    $item_output .= $args->link_after;
    $item_output .= '</span>';
    if (!empty( $item->htmlcontent )) {
    $item_output .= '<div class="mega-menu-widget">'.do_shortcode($item->htmlcontent).'</div>';
    }
    $item_output .= $args->after;
    } else {
    $item_output = $args->before;
    $item_output .= '<a'. $attributes .'>';
    if (!empty( $item->menuicon )) {
    $item_output .= '<i class="'.$item->menuicon.'"></i>';
    }
    $item_output .= '<span class="title">';
    $item_output .= $args->link_before .$prepend.apply_filters( 'the_title', $item->title, $item->ID ).$append;
    $item_output .= $args->link_after;
    $item_output .= '</span>';
    //$item_output .= $description.$args->link_after;
    //$item_output .= ' '.$item->subtitle.'</a>';
    $item_output .= '</a>';
    if (!empty( $item->htmlcontent )) {
    $item_output .= '<div class="mega-menu-widget">'.do_shortcode($item->htmlcontent).'</div>';
    }
    $item_output .= $args->after;
    }
    
    $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
    
    }
    }

    and you will see I am attempting to give the actual menu item name a span class to wrap itself in, so that I can just set that span class to display: none using CSS. How can I call that function in my child theme functions.php?

    #106608
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please explain your issue with marked screenshot and provide me website url to get exact solution.
    Thanks 🙂
    With Best Regards
    Mohammad

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

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register