Digital experiences for all disciplines
New Landing › How can we help? › Cardinal › Adding Medium to Social Profiles
New Landing › How can we help? › Cardinal › Adding Medium to Social Profiles
- This topic has 15 replies, 5 voices, and was last updated 8 years by Kyle – SUPPORT.
-
Posted in: Cardinal
-
December 1, 2015 at 10:04 pm #232568
Hi there,
I would like to add a Medium account to the social profiles section in the header etc.
I did a search and read the support topic http://www.swiftideas.com/forums/topic/add-vkontakte-icon-social/ and I tried following the instructions but cannot find the shortcodes php file as outlined in the replies (cardinal/swift-framework/core/shortcodes.php)
I have attached a screengrab of what is there for me in …cardinal/swift-framework/core/
Can you please advise?
Thanks a million,
Conor
Attachments:
You must be logged in to view attached files.December 2, 2015 at 11:07 am #232630Hi
That file is now located in plugins/swift-framework/core
– Kyle
December 2, 2015 at 3:40 pm #232735Hey Kyle,
Thanks for replying. It doesn’t appear to be there for me either I’m afraid.
Attachments:
You must be logged in to view attached files.December 2, 2015 at 3:46 pm #232741Sorry, a better way is to 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 = ""; 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']; } $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"; } 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"; } } 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"; } 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"; } } } $output = '<ul class="social-icons ' . $size . ' ' . $style . '">' . "\n"; $output .= $social_icons; $output .= '</ul>' . "\n"; return $output; } add_shortcode( "social", "sf_social_icons" ); }
– Kyle
December 2, 2015 at 5:02 pm #232783Thanks Kyle, so I added that to functions.php and swapped out “vk” for “medium” and the links and fontawesome icons but it didn’t seem to change anything, what do you think I’m doing wrong? Apologies if I’m asking too much!
This is what I have in there:
<?php
/* 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 = “”;
$medium = $sf_options[‘medium_url’];
$twitch = “”;
if ( isset( $sf_options[‘yelp_url’] ) ) {
$yelp = $sf_options[‘yelp_url’];
}
if ( isset( $sf_options[‘medium_url’] ) ) {
$medium = $sf_options[‘medium_url’];
}
if ( isset( $sf_options[‘twitch_url’] ) ) {
$twitch = $sf_options[‘twitch_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”;
}
if ( $behance ) {
$social_icons .= ‘<li class=”behance”><i class=”fa-behance”></i><i class=”fa-behance”></i>‘ . “\n”;
}
if ( $deviantart ) {
$social_icons .= ‘<li class=”deviantart”><i class=”fa-deviantart”></i><i class=”fa-deviantart”></i>‘ . “\n”;
}
if ( $soundcloud ) {
$social_icons .= ‘<li class=”soundcloud”><i class=”fa-soundcloud”></i><i class=”fa-soundcloud”></i>‘ . “\n”;
}
if ( $yelp ) {
$social_icons .= ‘<li class=”yelp”><i class=”fa-yelp”></i><i class=”fa-yelp”></i>‘ . “\n”;
}
if ( $rss ) {
$social_icons .= ‘<li class=”rss”><i class=”fa-rss”></i><i class=”fa-rss”></i>‘ . “\n”;
}
if ( $medium ) {
$social_icons .= ‘<li class=”medium”><i class=”fa-medium”></i><i class=”fa-medium”></i>‘ . “\n”;
}
if ( $twitch ) {
$social_icons .= ‘<li class=”twitch”><i class=”fa-twitch”></i><i class=”fa-twitch”></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”;
}
if ( $id == “behance” ) {
$social_icons .= ‘<li class=”behance”><i class=”fa-behance”></i><i class=”fa-behance”></i>‘ . “\n”;
}
if ( $id == “deviantart” ) {
$social_icons .= ‘<li class=”deviantart”><i class=”fa-deviantart”></i><i class=”fa-deviantart”></i>‘ . “\n”;
}
if ( $id == “soundcloud” ) {
$social_icons .= ‘<li class=”soundcloud”><i class=”fa-soundcloud”></i><i class=”fa-soundcloud”></i>‘ . “\n”;
}
if ( $id == “yelp” ) {
$social_icons .= ‘<li class=”yelp”><i class=”fa-yelp”></i><i class=”fa-yelp”></i>‘ . “\n”;
}
if ( $id == “rss” ) {
$social_icons .= ‘<li class=”rss”><i class=”fa-rss”></i><i class=”fa-rss”></i>‘ . “\n”;
}
if ( $id == “medium” ) {
$social_icons .= ‘<li class=”medium”><i class=”fa-medium”></i><i class=”fa-medium”></i>‘ . “\n”;
}
if ( $id == “twitch” ) {
$social_icons .= ‘<li class=”twitch”><i class=”fa-twitch”></i><i class=”fa-twitch”></i>‘ . “\n”;
}
}
}$output = ‘<ul class=”social-icons ‘ . $size . ‘ ‘ . $style . ‘”>’ . “\n”;
$output .= $social_icons;
$output .= ‘‘ . “\n”;return $output;
}add_shortcode( “social”, “sf_social_icons” );
}/*
*
* Cardinal Functions – Child Theme
* ————————————————
* These functions will override the parent theme
* functions. We have provided some examples below.
*
*
*//* LOAD THEME LANGUAGE
================================================== */
/*
* You can uncomment the line below to include your own translations
* into your child theme, simply create a “language” folder and add your po/mo files
*/// load_theme_textdomain(‘swiftframework’, get_stylesheet_directory_uri().’/language’);
/* REMOVE PAGE BUILDER ASSETS
================================================== */
/*
* You can uncomment the line below to remove selected assets from the page builder
*/// function spb_remove_assets( $pb_assets ) {
// unset($pb_assets[‘parallax’]);
// return $pb_assets;
// }
// add_filter( ‘spb_assets_filter’, ‘spb_remove_assets’ );/* ADD/EDIT PAGE BUILDER TEMPLATES
================================================== */
function custom_prebuilt_templates($prebuilt_templates) {/*
* You can uncomment the lines below to add custom templates
*/
// $prebuilt_templates[“custom”] = array(
// ‘id’ => “custom”,
// ‘name’ => ‘Custom’,
// ‘code’ => ‘your-code-here’
// );/*
* You can uncomment the lines below to remove default templates
*/
// unset($prebuilt_templates[‘home-1’]);
// unset($prebuilt_templates[‘home-2’]);// return templates array
return $prebuilt_templates;}
//add_filter( ‘spb_prebuilt_templates’, ‘custom_prebuilt_templates’ );?>
December 2, 2015 at 6:10 pm #232825You are trying to get a variable that does not exist:
$medium = $sf_options['medium_url'];
Replace the option key
medium_url
back to the origionalvk_url
as that is looking in the theme options panel. In the theme options panel, enter your medium URL in the VK setting.Thanks,
David.December 2, 2015 at 7:59 pm #232861Like so? The link is working but the medium font awesome icon doesn’t seem to display, the VK one is still there. 🙁 Sorry for all this hassle!
/* 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 = “”;
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’];
}$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”;
}
if ( $behance ) {
$social_icons .= ‘<li class=”behance”><i class=”fa-behance”></i><i class=”fa-behance”></i>‘ . “\n”;
}
if ( $deviantart ) {
$social_icons .= ‘<li class=”deviantart”><i class=”fa-deviantart”></i><i class=”fa-deviantart”></i>‘ . “\n”;
}
if ( $soundcloud ) {
$social_icons .= ‘<li class=”soundcloud”><i class=”fa-soundcloud”></i><i class=”fa-soundcloud”></i>‘ . “\n”;
}
if ( $yelp ) {
$social_icons .= ‘<li class=”yelp”><i class=”fa-yelp”></i><i class=”fa-yelp”></i>‘ . “\n”;
}
if ( $rss ) {
$social_icons .= ‘<li class=”rss”><i class=”fa-rss”></i><i class=”fa-rss”></i>‘ . “\n”;
}
if ( $vk ) {
$social_icons .= ‘<li class=”vk”><i class=”fa-medium”></i><i class=”fa-medium”></i>‘ . “\n”;
}
if ( $twitch ) {
$social_icons .= ‘<li class=”twitch”><i class=”fa-twitch”></i><i class=”fa-twitch”></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”;
}
if ( $id == “behance” ) {
$social_icons .= ‘<li class=”behance”><i class=”fa-behance”></i><i class=”fa-behance”></i>‘ . “\n”;
}
if ( $id == “deviantart” ) {
$social_icons .= ‘<li class=”deviantart”><i class=”fa-deviantart”></i><i class=”fa-deviantart”></i>‘ . “\n”;
}
if ( $id == “soundcloud” ) {
$social_icons .= ‘<li class=”soundcloud”><i class=”fa-soundcloud”></i><i class=”fa-soundcloud”></i>‘ . “\n”;
}
if ( $id == “yelp” ) {
$social_icons .= ‘<li class=”yelp”><i class=”fa-yelp”></i><i class=”fa-yelp”></i>‘ . “\n”;
}
if ( $id == “rss” ) {
$social_icons .= ‘<li class=”rss”><i class=”fa-rss”></i><i class=”fa-rss”></i>‘ . “\n”;
}
if ( $id == “vk” ) {
$social_icons .= ‘<li class=”vk”><i class=”fa-medium”></i><i class=”fa-medium”></i>‘ . “\n”;
}
if ( $id == “twitch” ) {
$social_icons .= ‘<li class=”twitch”><i class=”fa-twitch”></i><i class=”fa-twitch”></i>‘ . “\n”;
}
}
}$output = ‘<ul class=”social-icons ‘ . $size . ‘ ‘ . $style . ‘”>’ . “\n”;
$output .= $social_icons;
$output .= ‘‘ . “\n”;return $output;
}add_shortcode( “social”, “sf_social_icons” );
}December 2, 2015 at 8:28 pm #232872No problem, try changing this:
$social_icons .= '<li class="vk"><i class="fa-medium"></i><i class="fa-medium"></i>' . "\n";
To this:
$social_icons .= '<li class="medium"><i class="fa fa-medium"></i><i class="fa fa-medium"></i>' . "\n";
December 2, 2015 at 8:34 pm #232874This reply has been marked as private.December 2, 2015 at 8:39 pm #232875Sure, could you add your FTP details, it’s safer to look at the code that way.
Thanks.
December 2, 2015 at 9:04 pm #232881This reply has been marked as private.December 4, 2015 at 12:38 pm #233332This is odd, the child theme is not using that function. Is the child theme activated?
Please add me a WP login.
Thanks.
December 8, 2015 at 9:46 pm #234042This reply has been marked as private.December 9, 2015 at 6:20 am #234074Hi,
I have tried to manage it so please check. Let me know your feedback.
Thanks
MohammadJanuary 21, 2016 at 9:45 am #242446Could you guys at swift integrate medium in your next update? I’d also love to have the icon displayed.
-
Posted in: Cardinal
You must be logged in and have valid license to reply to this topic.