New Landing How can we help? Themeforest Theme Support Dante How to add link to top Menu bar

Viewing 4 posts - 1 through 4 (of 4 total)
  • Posted in: Dante
  • #82415
    qubed
    Member
    Post count: 44

    Hello,

    I am looking to add a link on the menu bar that login/sign out, my account, language and the cart button are.

    I’d like the link to be placed to the left of the login / sign out, but I’m not quite sure how or where to do this.

    Thank you,

    qubed

    #82604
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    You need to open sf-header.php in the includes folder, then swiftframework. Go to line 515 and you will see the start of the code for AUX links

    – Kyle

    #82650
    qubed
    Member
    Post count: 44

    Thanks Kyle,

    I have a follow-up question regarding this, I am using the child theme, is there a way to make the changes through the child theme so these customisations aren’t lost when updating the main theme?

    Cheers,

    qubed

    #82651
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Yes, you need to copy from the if statement and paste in your child theme functions.php file:

    if (!function_exists('sf_aux_links')) {
    		function sf_aux_links($position, $alt_version = FALSE, $header_version = "") {
    		
    			// VARIABLES
    			$login_url = wp_login_url();
    			$logout_url = wp_logout_url( home_url() );
    			$myaccount_page_id = get_option( 'woocommerce_myaccount_page_id' );
    			if ( $myaccount_page_id ) {
    				$logout_url = wp_logout_url( get_permalink( $myaccount_page_id ) );
    			  	$login_url = get_permalink( $myaccount_page_id );
    			  	if ( get_option( 'woocommerce_force_ssl_checkout' ) == 'yes' ) {
    			    	$logout_url = str_replace( 'http:', 'https:', $logout_url );
    					$login_url = str_replace( 'http:', 'https:', $login_url );
    				}
    			}
    			$options = get_option('sf_dante_options');
    			$show_sub = $options['show_sub'];
    			$show_translation = $options['show_translation'];
    			$sub_code = $options['sub_code'];
    			$show_account = $options['show_account'];
    			$show_cart = $options['show_cart'];
    			$show_wishlist = $options['show_wishlist'];
    			$tb_search_text = $options['tb_search_text'];
    			$aux_links_output = $ss_enable = "";
    			
    			if (isset($options['ss_enable'])) {
    				$ss_enable = $options['ss_enable'];
    			} else {
    				$ss_enable = true;
    			}
    			
    			// LINKS + SEARCH OUTPUT
    			$aux_links_output .= '<nav class="std-menu '.$position.'">'. "\n";
    			$aux_links_output .= '<ul class="menu">'. "\n";
    			if ($show_account) {
    				if (is_user_logged_in()) {
    					$aux_links_output .= '<li><a href="'.wp_logout_url(home_url()).'">'. __("Sign Out", "swiftframework") .'</a></li>'. "\n";
    					if ( $myaccount_page_id ) {
    					$aux_links_output .= '<li><a href="'.get_permalink( $myaccount_page_id ).'" class="admin-link">'. __("My Account", "swiftframework") .'</a></li>'. "\n";
    					} else {
    					$aux_links_output .= '<li><a href="'.get_admin_url().'" class="admin-link">'. __("My Account", "swiftframework") .'</a></li>'. "\n";
    					}
    				} else {
    					$aux_links_output .= '<li><a href="'.$login_url.'">'. __("Login", "swiftframework") .'</a></li>'. "\n";			
    				}
    			}
    			if ($show_sub) {
    				$aux_links_output .= '<li class="parent"><a href="#">'. __("Subscribe", "swiftframework") .'</a>'. "\n";
    				$aux_links_output .= '<ul class="sub-menu">'. "\n";
    				$aux_links_output .= '<li><div id="header-subscribe" class="clearfix">'. "\n";
    				$aux_links_output .= do_shortcode($sub_code) . "\n";
    				$aux_links_output .= '</div></li>'. "\n";
    				$aux_links_output .= '</ul>'. "\n";
    				$aux_links_output .= '</li>'. "\n";
    			}
    			if ($show_translation) {
    				$aux_links_output .= '<li class="parent aux-languages"><a href="#">'. __("Language", "swiftframework") .'</a>'. "\n";
    				$aux_links_output .= '<ul id="header-languages" class="sub-menu">'. "\n";
    				if (function_exists( 'sf_language_flags' )) {
    				$aux_links_output .= sf_language_flags();
    				}
    				$aux_links_output .= '</ul>'. "\n";
    				$aux_links_output .= '</li>'. "\n";
    			}
    			if ($header_version != "header-1") {
    				if ($show_cart) {
    				$aux_links_output .= sf_get_cart();
    				}
    				if ( class_exists( 'YITH_WCWL_UI' ) && $show_wishlist)  {
    				$aux_links_output .= sf_get_wishlist();
    				}
    			}
    				if (($position == "header-menu" && !$alt_version) && $ss_enable) {
    				$aux_links_output .= '<li><a class="swift-search-link" href="#"><i class="ss-zoomin"></i><span>'.do_shortcode($tb_search_text).'</span></a></li>'. "\n";		
    				}
    			$aux_links_output .= '</ul>'. "\n";
    			$aux_links_output .= '</nav>'. "\n";
    		
    		
    			// RETURN
    			return $aux_links_output;
    		}
    	}

    – Kyle

Viewing 4 posts - 1 through 4 (of 4 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