New Landing How can we help? Atelier Reorder social buttons

Viewing 14 posts - 1 through 14 (of 14 total)
  • Posted in: Atelier
  • #290881
    adriboixet
    Member
    Post count: 41

    Hi,

    It’s possible to choose the order of the buttons??? I don’t see the option and I don’t like to appear first twitter 🙂

    #290882
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    For your social profiles or for sharing on posts? It will require editing the theme files

    – Kyle

    #290883
    adriboixet
    Member
    Post count: 41

    Social profiles in header.

    #290886
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Ok what order would you like?

    – Kyle

    #290887
    adriboixet
    Member
    Post count: 41

    Facebook, instagram, twitter, skype

    #290889
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Add this to your child theme’s functions.php file:

        /* SOCIAL SHORTCODE
    	================================================= */
        if ( ! function_exists( 'sf_social_icons' ) ) {
            function sf_social_icons( $atts, $content = null ) {
                extract( shortcode_atts( array(
                    "type"  => '',
                    "size"  => 'standard',
                    "style" => ''
                ), $atts ) );
    
                global $sf_options;
    
                $twitter    = $sf_options['twitter_username'];
                $facebook   = $sf_options['facebook_page_url'];
                $dribbble   = $sf_options['dribbble_username'];
                $vimeo      = $sf_options['vimeo_username'];
                $tumblr     = $sf_options['tumblr_username'];
                $skype      = $sf_options['skype_username'];
                $linkedin   = $sf_options['linkedin_page_url'];
                $googleplus = $sf_options['googleplus_page_url'];
                $flickr     = $sf_options['flickr_page_url'];
                $youtube    = $sf_options['youtube_url'];
                $pinterest  = $sf_options['pinterest_username'];
                $foursquare = $sf_options['foursquare_url'];
                $instagram  = $sf_options['instagram_username'];
                $github     = $sf_options['github_url'];
                $xing       = $sf_options['xing_url'];
                $rss        = $sf_options['rss_url'];
                $behance    = $sf_options['behance_url'];
                $soundcloud = $sf_options['soundcloud_url'];
                $deviantart = $sf_options['deviantart_url'];
                $yelp       = "";
                $vk         = "";
                $twitch     = "";
                $snapchat   = "";
                $whatsapp   = "";
                if ( isset( $sf_options['yelp_url'] ) ) {
                    $yelp = $sf_options['yelp_url'];
                }
                if ( isset( $sf_options['vk_url'] ) ) {
                    $vk = $sf_options['vk_url'];
                }
                if ( isset( $sf_options['twitch_url'] ) ) {
                    $twitch = $sf_options['twitch_url'];
                }
                if ( isset( $sf_options['snapchat_url'] ) ) {
                    $snapchat = $sf_options['snapchat_url'];
                }
                if ( isset( $sf_options['whatsapp_url'] ) ) {
                    $whatsapp = $sf_options['whatsapp_url'];
                }
    
                $social_icons = '';
    
                if ( $type == '' ) {
    
                    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 ( $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 ( $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 ( $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 ( $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";
                    }
                    if ( $behance ) {
                        $social_icons .= '<li class="behance"><a href="' . $behance . '" target="_blank"><i class="fa-behance"></i><i class="fa-behance"></i></a></li>' . "\n";
                    }
                    if ( $deviantart ) {
                        $social_icons .= '<li class="deviantart"><a href="' . $deviantart . '" target="_blank"><i class="fa-deviantart"></i><i class="fa-deviantart"></i></a></li>' . "\n";
                    }
                    if ( $soundcloud ) {
                        $social_icons .= '<li class="soundcloud"><a href="' . $soundcloud . '" target="_blank"><i class="fa-soundcloud"></i><i class="fa-soundcloud"></i></a></li>' . "\n";
                    }
                    if ( $yelp ) {
                        $social_icons .= '<li class="yelp"><a href="' . $yelp . '" target="_blank"><i class="fa-yelp"></i><i class="fa-yelp"></i></a></li>' . "\n";
                    }
                    if ( $rss ) {
                        $social_icons .= '<li class="rss"><a href="' . $rss . '" target="_blank"><i class="fa-rss"></i><i class="fa-rss"></i></a></li>' . "\n";
                    }
                    if ( $vk ) {
                        $social_icons .= '<li class="vk"><a href="' . $vk . '" target="_blank"><i class="fa-vk"></i><i class="fa-vk"></i></a></li>' . "\n";
                    }
                    if ( $twitch ) {
                        $social_icons .= '<li class="twitch"><a href="' . $twitch . '" target="_blank"><i class="fa-twitch"></i><i class="fa-twitch"></i></a></li>' . "\n";
                    }
                    if ( $snapchat ) {
                        $social_icons .= '<li class="snapchat"><a href="' . $snapchat . '" target="_blank"><i class="fa-snapchat"></i><i class="fa-snapchat"></i></a></li>' . "\n";
                    }
                    if ( $whatsapp ) {
                        $social_icons .= '<li class="whatsapp"><a href="' . $whatsapp . '" target="_blank"><i class="fa-whatsapp"></i><i class="fa-whatsapp"></i></a></li>' . "\n";
                    }
                } else {
    
                    $social_type = explode( ',', $type );
                    foreach ( $social_type as $id ) {
                         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 == "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 == "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 == "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 == "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";
                        }
                        if ( $id == "behance" ) {
                            $social_icons .= '<li class="behance"><a href="' . $behance . '" target="_blank"><i class="fa-behance"></i><i class="fa-behance"></i></a></li>' . "\n";
                        }
                        if ( $id == "deviantart" ) {
                            $social_icons .= '<li class="deviantart"><a href="' . $deviantart . '" target="_blank"><i class="fa-deviantart"></i><i class="fa-deviantart"></i></a></li>' . "\n";
                        }
                        if ( $id == "soundcloud" ) {
                            $social_icons .= '<li class="soundcloud"><a href="' . $soundcloud . '" target="_blank"><i class="fa-soundcloud"></i><i class="fa-soundcloud"></i></a></li>' . "\n";
                        }
                        if ( $id == "yelp" ) {
                            $social_icons .= '<li class="yelp"><a href="' . $yelp . '" target="_blank"><i class="fa-yelp"></i><i class="fa-yelp"></i></a></li>' . "\n";
                        }
                        if ( $id == "rss" ) {
                            $social_icons .= '<li class="rss"><a href="' . $rss . '" target="_blank"><i class="fa-rss"></i><i class="fa-rss"></i></a></li>' . "\n";
                        }
                        if ( $id == "vk" ) {
                            $social_icons .= '<li class="vk"><a href="' . $vk . '" target="_blank"><i class="fa-vk"></i><i class="fa-vk"></i></a></li>' . "\n";
                        }
                        if ( $id == "twitch" ) {
                            $social_icons .= '<li class="twitch"><a href="' . $twitch . '" target="_blank"><i class="fa-twitch"></i><i class="fa-twitch"></i></a></li>' . "\n";
                        }
                        if ( $id == "snapchat" ) {
                            $social_icons .= '<li class="snapchat"><a href="' . $snapchat . '" target="_blank"><i class="fa-snapchat"></i><i class="fa-snapchat"></i></a></li>' . "\n";
                        }
                        if ( $id == "whatsapp" ) {
                            $social_icons .= '<li class="whatsapp"><a href="' . $whatsapp . '" target="_blank"><i class="fa-whatsapp"></i><i class="fa-whatsapp"></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" );
            add_shortcode( "sf_social", "sf_social_icons" );
        }

    – Kyle

    #290977
    adriboixet
    Member
    Post count: 41

    Thanks!

    I’ve problem with WPML nav in header. This show’s all languages even though the page doesn’t translated.

    #290978
    adriboixet
    Member
    Post count: 41

    Sorry, I add this code but icons not reorder.

    #291110
    David Martin – Support
    Moderator
    Post count: 20834

    You need to actually edit the PHP code to change the order.

    – David.

    #291121
    adriboixet
    Member
    Post count: 41

    I’m trying to change the order with php code, but doesn’t work…

    #291125
    David Martin – Support
    Moderator
    Post count: 20834

    Better add your FTP details so we can see what your trying to do.

    – David.

    #291137
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    Apologies, this code has been moved to the swift framework plugin, so it’s not possible to overwrite in the child theme. You will need to edit the order in wp-content/plugins/swift-framework/includes/shortcodes/sf-shortcodes.php

    – Kyle

    #291149
    adriboixet
    Member
    Post count: 41

    Oh, thanks.

    Maybe in future updates would be interesting add the option to choose order of social icons 🙂

    #291152
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    No problem

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