New Landing How can we help? Themeforest Theme Support Dante Add Font Awesome Icon to Social Media Header

Viewing 15 posts - 1 through 15 (of 21 total)
  • Posted in: Dante
  • #52718
    Kimley
    Member
    Post count: 15

    I’d like to add the font awesome phone icon to the right of the social media icons in the header and have it link to the contact page.

    This is what I’ve got so far on my dev site:
    http://jspigner.pairserver.com

    I’d like the phone to be the same size as the social media icons, have a similar hover effect and be placed to the right of the social media icons.

    Please let me know if this is possible without customizations.

    Thanks so much!

    #52736
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please open to edit shortcodes.php at /dante/swift-framework/

    
    Find this code at line 758 - 760 
    if ($id == "xing") {
    $social_icons .= '<li class="xing"><a href="'.$xing.'" target="_blank"><i class="fa-xing"></i><i class="fa-xing"></i></a></li>'."\n";
    }
    
    and put this code after these lines 
    
    $social_icons .= '<li class="phone"><a href="http://jspigner.pairserver.com/contact-us/" target="_blank"><i class="fa-phone"></i><i class="fa-phone"></i></a></li>'."\n";

    It will make your desire change .

    Thanks
    With Best Regards
    Swift Ideas

    #53051
    Kimley
    Member
    Post count: 15

    Thanks so much for the super quick reply!

    This almost worked however it added two phone icons to the right of each of my social media icons. But you sent me in the right direction and I was able to configure it exactly how I wanted it.

    Since I’ve now made changes to the shortcodes file, will these be lost if I update the theme? Will using a child theme save these if I update?

    Thanks so much for your help!!!

    Kimley

    #53083
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    You most welcome .I amglad that issue fixed . Please activate your child theme and put this code functions.php at /wp-content/themes/dante-child/ . So you can keep this after update .
    /* SOCIAL SHORTCODE
    ================================================= */
    if (!function_exists(‘sf_social_icons’)) {
    function sf_social_icons($atts, $content = null) {
    extract(shortcode_atts(array(
    “type” => ”,
    “size” => ‘standard’,
    “style” => ”
    ), $atts));

    $options = get_option(‘sf_dante_options’);

    $twitter = $options[‘twitter_username’];
    $facebook = $options[‘facebook_page_url’];
    $dribbble = $options[‘dribbble_username’];
    $vimeo = $options[‘vimeo_username’];
    $tumblr = $options[‘tumblr_username’];
    $skype = $options[‘skype_username’];
    $linkedin = $options[‘linkedin_page_url’];
    $googleplus = $options[‘googleplus_page_url’];
    $flickr = $options[‘flickr_page_url’];
    $youtube = $options[‘youtube_url’];
    $pinterest = $options[‘pinterest_username’];
    $foursquare = $options[‘foursquare_url’];
    $instagram = $options[‘instagram_username’];
    $github = $options[‘github_url’];
    $xing = $options[‘xing_url’];

    $social_icons = ”;

    if ($type == ”) {
    if ($twitter) {
    $social_icons .= ‘<li class=”twitter”><i class=”fa-twitter”></i><i class=”fa-twitter”></i>‘.”\n”;
    }
    if ($facebook) {
    $social_icons .= ‘<li class=”facebook”><i class=”fa-facebook”></i><i class=”fa-facebook”></i>‘.”\n”;
    }
    if ($dribbble) {
    $social_icons .= ‘<li class=”dribbble”><i class=”fa-dribbble”></i><i class=”fa-dribbble”></i>‘.”\n”;
    }
    if ($youtube) {
    $social_icons .= ‘<li class=”youtube”><i class=”fa-youtube”></i><i class=”fa-youtube”></i>‘.”\n”;
    }
    if ($vimeo) {
    $social_icons .= ‘<li class=”vimeo”><i class=”fa-vimeo-square”></i><i class=”fa-vimeo-square”></i>‘.”\n”;
    }
    if ($tumblr) {
    $social_icons .= ‘<li class=”tumblr”><i class=”fa-tumblr”></i><i class=”fa-tumblr”></i>‘.”\n”;
    }
    if ($skype) {
    $social_icons .= ‘<li class=”skype”><i class=”fa-skype”></i><i class=”fa-skype”></i>‘.”\n”;
    }
    if ($linkedin) {
    $social_icons .= ‘<li class=”linkedin”><i class=”fa-linkedin”></i><i class=”fa-linkedin”></i>‘.”\n”;
    }
    if ($googleplus) {
    $social_icons .= ‘<li class=”googleplus”><i class=”fa-google-plus”></i><i class=”fa-google-plus”></i>‘.”\n”;
    }
    if ($flickr) {
    $social_icons .= ‘<li class=”flickr”><i class=”fa-flickr”></i><i class=”fa-flickr”></i>‘.”\n”;
    }
    if ($pinterest) {
    $social_icons .= ‘<li class=”pinterest”><i class=”fa-pinterest”></i><i class=”fa-pinterest”></i>‘.”\n”;
    }
    if ($foursquare) {
    $social_icons .= ‘<li class=”foursquare”><i class=”fa-foursquare”></i><i class=”fa-foursquare”></i>‘.”\n”;
    }
    if ($instagram) {
    $social_icons .= ‘<li class=”instagram”><i class=”fa-instagram”></i><i class=”fa-instagram”></i>‘.”\n”;
    }
    if ($github) {
    $social_icons .= ‘<li class=”github”><i class=”fa-github”></i><i class=”fa-github”></i>‘.”\n”;
    }
    if ($xing) {
    $social_icons .= ‘<li class=”xing”><i class=”fa-xing”></i><i class=”fa-xing”></i>‘.”\n”;
    }
    } else {

    $social_type = explode(‘,’, $type);
    foreach ($social_type as $id) {
    if ($id == “twitter”) {
    $social_icons .= ‘<li class=”twitter”><i class=”fa-twitter”></i><i class=”fa-twitter”></i>‘.”\n”;
    }
    if ($id == “facebook”) {
    $social_icons .= ‘<li class=”facebook”><i class=”fa-facebook”></i><i class=”fa-facebook”></i>‘.”\n”;
    }
    if ($id == “dribbble”) {
    $social_icons .= ‘<li class=”dribbble”><i class=”fa-dribbble”></i><i class=”fa-dribbble”></i>‘.”\n”;
    }
    if ($id == “youtube”) {
    $social_icons .= ‘<li class=”youtube”><i class=”fa-youtube”></i><i class=”fa-youtube”></i>‘.”\n”;
    }
    if ($id == “vimeo”) {
    $social_icons .= ‘<li class=”vimeo”><i class=”fa-vimeo-square”></i><i class=”fa-vimeo-square”></i>‘.”\n”;
    }
    if ($id == “tumblr”) {
    $social_icons .= ‘<li class=”tumblr”><i class=”fa-tumblr”></i><i class=”fa-tumblr”></i>‘.”\n”;
    }
    if ($id == “skype”) {
    $social_icons .= ‘<li class=”skype”><i class=”fa-skype”></i><i class=”fa-skype”></i>‘.”\n”;
    }
    if ($id == “linkedin”) {
    $social_icons .= ‘<li class=”linkedin”><i class=”fa-linkedin”></i><i class=”fa-linkedin”></i>‘.”\n”;
    }
    if ($id == “googleplus” || $id == “google-plus” || $id == “google+”) {
    $social_icons .= ‘<li class=”googleplus”><i class=”fa-google-plus”></i><i class=”fa-google-plus”></i>‘.”\n”;
    }
    if ($id == “flickr”) {
    $social_icons .= ‘<li class=”flickr”><i class=”fa-flickr”></i><i class=”fa-flickr”></i>‘.”\n”;
    }
    if ($id == “pinterest”) {
    $social_icons .= ‘<li class=”pinterest”><i class=”fa-pinterest”></i><i class=”fa-pinterest”></i>‘.”\n”;
    }
    if ($id == “foursquare”) {
    $social_icons .= ‘<li class=”foursquare”><i class=”fa-foursquare”></i><i class=”fa-foursquare”></i>‘.”\n”;
    }
    if ($id == “instagram”) {
    $social_icons .= ‘<li class=”instagram”><i class=”fa-instagram”></i><i class=”fa-instagram”></i>‘.”\n”;
    }
    if ($id == “github”) {
    $social_icons .= ‘<li class=”github”><i class=”fa-github”></i><i class=”fa-github”></i>‘.”\n”;
    }
    if ($id == “xing”) {
    $social_icons .= ‘<li class=”xing”><i class=”fa-xing”></i><i class=”fa-xing”></i>‘.”\n”;
    }

    $social_icons .= ‘<li class=”phone”><i class=”fa-phone”></i><i class=”fa-phone”></i>‘.”\n”;

    }
    }

    $output = ‘<ul class=”social-icons ‘.$size.’ ‘.$style.'”>’.”\n”;
    $output .= $social_icons;
    $output .= ‘‘.”\n”;

    return $output;
    }
    add_shortcode(“social”, “sf_social_icons”);
    }

    #53084
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    You most welcome .I amglad that issue fixed . Please activate your child theme and put this code functions.php at /wp-content/themes/dante-child/ . So you can keep this after update .

    /* SOCIAL SHORTCODE
    	================================================= */
    	if (!function_exists('sf_social_icons')) {
    		function sf_social_icons($atts, $content = null) {
    			extract(shortcode_atts(array(
    			   "type" => '',
    			   "size" => 'standard',
    			   "style" => ''
    			), $atts));
    			
    			$options = get_option('sf_dante_options');
    	
    			$twitter = $options['twitter_username'];
    			$facebook = $options['facebook_page_url'];
    			$dribbble = $options['dribbble_username'];
    			$vimeo = $options['vimeo_username'];
    			$tumblr = $options['tumblr_username'];
    			$skype = $options['skype_username'];
    			$linkedin = $options['linkedin_page_url'];
    			$googleplus = $options['googleplus_page_url'];
    			$flickr = $options['flickr_page_url'];
    			$youtube = $options['youtube_url'];
    			$pinterest = $options['pinterest_username'];
    			$foursquare = $options['foursquare_url'];
    			$instagram = $options['instagram_username'];
    			$github = $options['github_url'];
    			$xing = $options['xing_url'];
    			
    			$social_icons = '';
    			
    			if ($type == '') {
    				if ($twitter) {
    					$social_icons .= '<li class="twitter"><a href="http://www.twitter.com/'.$twitter.'" target="_blank"><i class="fa-twitter"></i><i class="fa-twitter"></i></a></li>'."\n";
    				}
    				if ($facebook) {
    					$social_icons .= '<li class="facebook"><a href="'.$facebook.'" target="_blank"><i class="fa-facebook"></i><i class="fa-facebook"></i></a></li>'."\n";
    				}
    				if ($dribbble) {
    					$social_icons .= '<li class="dribbble"><a href="http://www.dribbble.com/'.$dribbble.'" target="_blank"><i class="fa-dribbble"></i><i class="fa-dribbble"></i></a></li>'."\n";
    				}
    				if ($youtube) {
    					$social_icons .= '<li class="youtube"><a href="'.$youtube.'" target="_blank"><i class="fa-youtube"></i><i class="fa-youtube"></i></a></li>'."\n";
    				}	
    				if ($vimeo) {
    					$social_icons .= '<li class="vimeo"><a href="http://www.vimeo.com/'.$vimeo.'" target="_blank"><i class="fa-vimeo-square"></i><i class="fa-vimeo-square"></i></a></li>'."\n";
    				}
    				if ($tumblr) {
    					$social_icons .= '<li class="tumblr"><a href="http://'.$tumblr.'.tumblr.com/" target="_blank"><i class="fa-tumblr"></i><i class="fa-tumblr"></i></a></li>'."\n";
    				}
    				if ($skype) {
    					$social_icons .= '<li class="skype"><a href="skype:'.$skype.'" target="_blank"><i class="fa-skype"></i><i class="fa-skype"></i></a></li>'."\n";
    				}
    				if ($linkedin) {
    					$social_icons .= '<li class="linkedin"><a href="'.$linkedin.'" target="_blank"><i class="fa-linkedin"></i><i class="fa-linkedin"></i></a></li>'."\n";
    				}
    				if ($googleplus) {
    					$social_icons .= '<li class="googleplus"><a href="'.$googleplus.'" target="_blank"><i class="fa-google-plus"></i><i class="fa-google-plus"></i></a></li>'."\n";
    				}
    				if ($flickr) {
    					$social_icons .= '<li class="flickr"><a href="'.$flickr.'" target="_blank"><i class="fa-flickr"></i><i class="fa-flickr"></i></a></li>'."\n";
    				}
    				if ($pinterest) {
    					$social_icons .= '<li class="pinterest"><a href="http://www.pinterest.com/'.$pinterest.'/" target="_blank"><i class="fa-pinterest"></i><i class="fa-pinterest"></i></a></li>'."\n";
    				}
    				if ($foursquare) {
    					$social_icons .= '<li class="foursquare"><a href="'.$foursquare.'" target="_blank"><i class="fa-foursquare"></i><i class="fa-foursquare"></i></a></li>'."\n";
    				}
    				if ($instagram) {
    					$social_icons .= '<li class="instagram"><a href="http://instagram.com/'.$instagram.'" target="_blank"><i class="fa-instagram"></i><i class="fa-instagram"></i></a></li>'."\n";
    				}
    				if ($github) {
    					$social_icons .= '<li class="github"><a href="'.$github.'" target="_blank"><i class="fa-github"></i><i class="fa-github"></i></a></li>'."\n";
    				}
    				if ($xing) {
    					$social_icons .= '<li class="xing"><a href="'.$xing.'" target="_blank"><i class="fa-xing"></i><i class="fa-xing"></i></a></li>'."\n";
    				}
    			} else {
    			
    				$social_type = explode(',', $type);
    				foreach ($social_type as $id) {
    					if ($id == "twitter") {
    						$social_icons .= '<li class="twitter"><a href="http://www.twitter.com/'.$twitter.'" target="_blank"><i class="fa-twitter"></i><i class="fa-twitter"></i></a></li>'."\n";
    					}
    					if ($id == "facebook") {
    						$social_icons .= '<li class="facebook"><a href="'.$facebook.'" target="_blank"><i class="fa-facebook"></i><i class="fa-facebook"></i></a></li>'."\n";
    					}
    					if ($id == "dribbble") {
    						$social_icons .= '<li class="dribbble"><a href="http://www.dribbble.com/'.$dribbble.'" target="_blank"><i class="fa-dribbble"></i><i class="fa-dribbble"></i></a></li>'."\n";
    					}
    					if ($id == "youtube") {
    						$social_icons .= '<li class="youtube"><a href="'.$youtube.'" target="_blank"><i class="fa-youtube"></i><i class="fa-youtube"></i></a></li>'."\n";
    					}
    					if ($id == "vimeo") {
    						$social_icons .= '<li class="vimeo"><a href="http://www.vimeo.com/'.$vimeo.'" target="_blank"><i class="fa-vimeo-square"></i><i class="fa-vimeo-square"></i></a></li>'."\n";
    					}
    					if ($id == "tumblr") {
    						$social_icons .= '<li class="tumblr"><a href="http://'.$tumblr.'.tumblr.com/" target="_blank"><i class="fa-tumblr"></i><i class="fa-tumblr"></i></a></li>'."\n";
    					}
    					if ($id == "skype") {
    						$social_icons .= '<li class="skype"><a href="skype:'.$skype.'" target="_blank"><i class="fa-skype"></i><i class="fa-skype"></i></a></li>'."\n";
    					}
    					if ($id == "linkedin") {
    						$social_icons .= '<li class="linkedin"><a href="'.$linkedin.'" target="_blank"><i class="fa-linkedin"></i><i class="fa-linkedin"></i></a></li>'."\n";
    					}
    					if ($id == "googleplus" || $id == "google-plus" || $id == "google+") {
    						$social_icons .= '<li class="googleplus"><a href="'.$googleplus.'" target="_blank"><i class="fa-google-plus"></i><i class="fa-google-plus"></i></a></li>'."\n";
    					}
    					if ($id == "flickr") {
    						$social_icons .= '<li class="flickr"><a href="'.$flickr.'" target="_blank"><i class="fa-flickr"></i><i class="fa-flickr"></i></a></li>'."\n";
    					}
    					if ($id == "pinterest") {
    						$social_icons .= '<li class="pinterest"><a href="http://www.pinterest.com/'.$pinterest.'/" target="_blank"><i class="fa-pinterest"></i><i class="fa-pinterest"></i></a></li>'."\n";
    					}
    					if ($id == "foursquare") {
    						$social_icons .= '<li class="foursquare"><a href="'.$foursquare.'" target="_blank"><i class="fa-foursquare"></i><i class="fa-foursquare"></i></a></li>'."\n";
    					}
    					if ($id == "instagram") {
    						$social_icons .= '<li class="instagram"><a href="http://instagram.com/'.$instagram.'" target="_blank"><i class="fa-instagram"></i><i class="fa-instagram"></i></a></li>'."\n";
    					}
    					if ($id == "github") {
    						$social_icons .= '<li class="github"><a href="'.$github.'" target="_blank"><i class="fa-github"></i><i class="fa-github"></i></a></li>'."\n";
    					}
    					if ($id == "xing") {
    						$social_icons .= '<li class="xing"><a href="'.$xing.'" target="_blank"><i class="fa-xing"></i><i class="fa-xing"></i></a></li>'."\n";
    					}
    					
    						$social_icons .= '<li class="phone"><a href="http://jspigner.pairserver.com/contact-us/" target="_blank"><i class="fa-phone"></i><i class="fa-phone"></i></a></li>'."\n";
    					
    				}
    			}
    			
    			$output = '<ul class="social-icons '.$size.' '.$style.'">'."\n";
    			$output .= $social_icons;
    			$output .= '</ul>'."\n";
    			
    			return $output;
    		}
    		add_shortcode("social", "sf_social_icons");
    	}
    	

    With Best Regards
    Swift Ideas

    #53188
    Kimley
    Member
    Post count: 15

    Great! Thanks so much again for all your help!

    Kimley

    #53473
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Great! 🙂

    #63815
    tracytracy
    Member
    Post count: 29

    Ok,I have the same question (wanting to add another icon in the social icon header) but I haven’t figured out how to change the code to add just ONE single icon instead of one icon after every social icons

    the code that was posted above:

    $social_icons .= '<li class="envelope"><a href=".../contact-us/" target="_blank"><i class="fa-envelope"></i><i class="fa-envelope"></i></a></li>'."\n";

    returns a page result of *twitter icon* *envelope icon* *facebook icon* *envelope icon* *github icon* *envelope icon* *youtube icon* *envelope icon* *flickr icon* *envelope icon*

    instead of the desired look of adding just the ONE icon at the end of the string.

    And my mucking about in the shortcodes.php trying to decipher how to change the above code isn’t working.
    How do I modify the code to add an additional icon in that row?
    thanks

    #63830
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    You used right code as i see . Please provide your website URl so i can check .

    Thanks

    #63841
    tracytracy
    Member
    Post count: 29

    I’m building this on a test server so I can’t share – I *only* added the extra code to the shortcodes.php file. Attaching a screen shot.

    #63849
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Where and how many times you added this code ?
    $social_icons .= '<li class="envelope"><a href=".../contact-us/" target="_blank"><i class="fa-envelope"></i><i class="fa-envelope"></i></a></li>'."\n";
    Please attach shortcodes.php as zip so i can correct your code .

    Thanks

    #63861
    tracytracy
    Member
    Post count: 29

    As I previously posted:

    I *only* added the extra code to the shortcodes.php file.

    I didn’t touch any other file. I followed the directions you posted above in reply #52736 and added the code to the shortcodes.php page

    dante/swift-framwork/shortcodes.php

    #63870
    Kimley
    Member
    Post count: 15

    Hi tracytracy,

    I had the same issue that you’re having. I altered the code as follows (obviously change your link and the icon you wish to use):

    					if ($id == "phone") {
    						$social_icons .= '<li class="phone"><a href="http://www.visionfirst.com/contact-us/"><i class="fa-phone"></i><i class="fa-phone"></i></a></li>'."\n";
    					}
    

    Let me know if you need any further clarification. Hope that helps!

    Kimley

    #63874
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    @tracytracy – please attach your shortcodes so i can check in detail .
    Thanks

    #63880
    tracytracy
    Member
    Post count: 29

    Kimley – Thanks, but just copy&pasting that code exactly just changes my results to having four little phone icons in the header instead of 4 little envelopes 😉 Obviously there is a key here that I’m missing.

    Is there more than this single step involved when wanting to add additional icons into the top header bar along side the social media icons?

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