Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › adding extra social icons
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › adding extra social icons
- This topic has 23 replies, 2 voices, and was last updated 10 years by Mohammad – SUPPORT.
-
Posted in: Neighborhood
-
April 1, 2014 at 11:05 am #63140
Hi, is it possible to add new social icons?
Need to add a http://soundcloud.com and http://mixcloud.com icons in the top bar.Im guessing i need to create the logos, then add coding…but if you can give me a example of what to do…this would be most appreciated.
Many thanks
BradleyApril 1, 2014 at 12:32 pm #63186Hi,
Please open to edit shortcodes.php at /neighborhood/includes/swift-framework/Find this code $output = '<ul class="social-icons '.$size.' '.$style.'">'."\n"; Replace with $sound_cloud_url = ''; //put url of sound cloud $mix_cloud_url = ''; //put url of mix cloud $social_icons .= '<li class="soundcloud"><a href="'.$sound_cloud_url.'/" target="_blank"><img src="IMAGE_URL_OF_SOUNDCLOUD" alt="" width="16" height="16" /></a></li>'."\n"; $social_icons .= '<li class="mixcloud"><a href="'.$mix_cloud_url.'/" target="_blank"><img src="IMAGE_URL_OF_MIXCLOUD" alt="" width="16" height="16" /></a></li>'."\n"; $output = '<ul class="social-icons '.$size.' '.$style.'">'."\n";
Hope it will help you .
Thanks 🙂
With Best Regards
Swift IdeasApril 1, 2014 at 2:54 pm #63265Hi Mohammad, am i supposed to remove/replace the two lines of this code – $output = ‘<ul class=”social-icons ‘.$size.’ ‘.$style.'”>’.”\n”;
one on line 30 and another around 276 which i removed and replaced the code.
im now getting a error code on my page http://fatfridge.co.uk
April 1, 2014 at 2:55 pm #63266this is the error message – Parse error: syntax error, unexpected T_VARIABLE in /home/cruelvap/public_html/fatfridge.co.uk/wp-content/themes/neighborhood/includes/swift-framework/shortcodes.php on line 30
April 1, 2014 at 2:56 pm #63267<?php /* SHORTCODE GENERATOR SETUP ================================================== */ // Create TinyMCE's editor button & plugin for Swift Framework Shortcodes add_action('init', 'sf_sc_button'); function sf_sc_button() { if ( current_user_can('edit_posts') && current_user_can('edit_pages') ) { add_filter('mce_external_plugins', 'add_tinymce_plugin'); add_filter('mce_buttons', 'register_button'); } } function register_button($button) { array_push($button, 'separator', 'swiftframework_shortcodes' ); return $button; } function add_tinymce_plugin($plugins) { $plugins['swiftframework_shortcodes'] = get_template_directory_uri() . '/includes/swift-framework/sf-shortcodes/tinymce.editor.plugin.js'; return $plugins; } function custom_mce_styles( $init ) { $init['theme_advanced_buttons2_add_before'] = 'styleselect'; $init['theme_advanced_styles'] = 'Impact Text=impact-text'; ret$output = '<ul class="social-icons '.$size.' '.$style.'">'."\n";urn $init; } add_filter( 'tiny_mce_before_init', 'custom_mce_styles' ); function sf_mce_css() { return get_template_directory_uri() . '/css/editor-style.css'; } add_filter( 'mce_css', 'sf_mce_css' ); /* ================================================== SHORTCODES OUTPUT ================================================== */ /* ALERT SHORTCODES ================================================== */ function sf_alert( $atts, $content = null ) { extract(shortcode_atts(array( "type" => "info" ), $atts)); return '<div class="alert '. $type .'">' . do_shortcode($content) . '</div>'; } add_shortcode('alert', 'sf_alert'); /* BUTTON SHORTCODES ================================================== */ function sf_button($atts, $content = null) { extract(shortcode_atts(array( "size" => "standard", "colour" => "", "type" => "", "link" => "#", "target" => '_self', "extra_class" => '' ), $atts)); if (($type == "squarearrow") || ($type == "slightlyroundedarrow") || ($type == "roundedarrow")) { return '<a class="sf-button '.$size.' '. $colour .' '. $type .' '. $extra_class .'" href="'.$link.'" target="'.$target.'"><span>' . do_shortcode($content) . '</span><span class="arrow"></span></a>'; } else { return '<a class="sf-button '.$size.' '. $colour .' '. $type .' '. $extra_class .'" href="'.$link.'" target="'.$target.'"><span>' . do_shortcode($content) . '</span></a>'; } } add_shortcode('button', 'sf_button'); /* ICON SHORTCODES ================================================== */ function sf_icon($atts, $content = null) { extract(shortcode_atts(array( "size" => "", "image" => "", "cont" => "", "float" => "" ), $atts)); if ($cont == "yes") { return '<div class="sf-icon-cont cont-'.$size.' sf-icon-float-'.$float.'"><i class="fa-'.$image.' sf-icon icon-'.$size.'"></i></div>'; } else { return '<i class="fa-'.$image.' sf-icon sf-icon-float-'.$float.' icon-'.$size.'"></i>'; } } add_shortcode('icon', 'sf_icon'); /* IMAGE BANNER SHORTCODE ================================================== */ function sf_imagebanner($atts, $content = null) { extract(shortcode_atts(array( "image" => "", "animation" => "fade-in", "contentpos" => "center", "textalign" => "center", "extraclass" => "" ), $atts)); $image_banner = ""; $image_banner .= '<div class="sf-image-banner '.$extraclass.'">'; $image_banner .= '<div class="image-banner-content sf-animation content-'.$contentpos.' text-'.$textalign.'" data-animation="'.$animation.'" data-delay="200">'; $image_banner .= do_shortcode($content); $image_banner .= '</div>'; $image_banner .= '<img src="'.$image.'" alt="" />'; $image_banner .= '</div>'; global $sf_has_imagebanner; $sf_has_imagebanner = true; return $image_banner; } add_shortcode('sf_imagebanner', 'sf_imagebanner'); /* COLUMN SHORTCODES ================================================== */ function one_third( $atts, $content = null ) { return '<div class="one_third">' . do_shortcode($content) . '</div>'; } add_shortcode('one_third', 'one_third'); function one_third_last( $atts, $content = null ) { return '<div class="one_third last">' . do_shortcode($content) . '</div><div class="clearboth"></div>'; } add_shortcode('one_third_last', 'one_third_last'); function two_third( $atts, $content = null ) { return '<div class="two_third">' . do_shortcode($content) . '</div>'; } add_shortcode('two_third', 'two_third'); function two_third_last( $atts, $content = null ) { return '<div class="two_third last">' . do_shortcode($content) . '</div><div class="clearboth"></div>'; } add_shortcode('two_third_last', 'two_third_last'); function one_half( $atts, $content = null ) { return '<div class="one_half">' . do_shortcode($content) . '</div>'; } add_shortcode('one_half', 'one_half'); function one_half_last( $atts, $content = null ) { return '<div class="one_half last">' . do_shortcode($content) . '</div><div class="clearboth"></div>'; } add_shortcode('one_half_last', 'one_half_last'); function one_fourth( $atts, $content = null ) { return '<div class="one_fourth">' . do_shortcode($content) . '</div>'; } add_shortcode('one_fourth', 'one_fourth'); function one_fourth_last( $atts, $content = null ) { return '<div class="one_fourth last">' . do_shortcode($content) . '</div><div class="clearboth"></div>'; } add_shortcode('one_fourth_last', 'one_fourth_last'); function three_fourth( $atts, $content = null ) { return '<div class="three_fourth">' . do_shortcode($content) . '</div>'; } add_shortcode('three_fourth', 'three_fourth'); function three_fourth_last( $atts, $content = null ) { return '<div class="three_fourth last">' . do_shortcode($content) . '</div><div class="clearboth"></div>'; } add_shortcode('three_fourth_last', 'three_fourth_last'); /* PERSON SHORTCODE ================================================= */ function person_widget($atts, $content = null) { extract(shortcode_atts(array( "name" => '', "role" => '', "src" => '' ), $atts)); $person_html = '<div class="person-widget">'; if ($src != '') { $person_html = $person_html . '<figure class="author-img"><img src="'.$src.'" alt="'.$name.'"/></figure>'; } $person_html = $person_html .'<h4>'.$name.'</h4><p class="role">'.$role.'</p><p>' . do_shortcode($content) . '</p></div>'; return $person_html; } add_shortcode("person", "person_widget"); function person_widget_last($atts, $content = null) { extract(shortcode_atts(array( "name" => '', "role" => '', "src" => '' ), $atts)); $person_html = '<div class="person-widget">'; if ($src != '') { $person_html = $person_html . '<figure class="author-img"><img src="'.$src.'" alt="'.$name.'"/></figure>'; } $person_html = $person_html .'<h4>'.$name.'</h4><p class="role">'.$role.'</p><p>' . do_shortcode($content) . '</p></div><div class="clearboth"></div>'; return $person_html; } add_shortcode("person_last", "person_widget_last"); /* CLIENT SHORTCODE ================================================= */ function client_box( $atts, $content = null ) { return '<div class="client-box"><img src="'. do_shortcode($content) .'" /></div>'; } add_shortcode('client_box', 'client_box'); function client_box_last( $atts, $content = null ) { return '<div class="client-box"><img src="'. do_shortcode($content) .'" /></div><div class="clearboth"></div>'; } add_shortcode('client_box_last', 'client_box_last'); /* ACCORDION SHORTCODES ================================================= */ function accordion_widget($atts, $content = null) { return '<div class="accordion">'. do_shortcode($content) .'</div>'; } add_shortcode("accordion", "accordion_widget"); function accordion_panel($atts, $content = null) { extract(shortcode_atts(array( "title" => '' ), $atts)); return '<div class="accordion-header">'.$title.'</div><div class="accordion-body">'. do_shortcode($content) .'</div>'; } add_shortcode("panel", "accordion_panel"); /* TABS SHORTCODES ================================================= */ // Setup a global int variable to enable unique tabbed content identities $i = 0; function tabbed_asset( $atts, $content = null ) { global $i; extract(shortcode_atts(array(), $atts)); $output = '<div class="tabbed-asset">'; $output .= '<ul class="tabs">'; foreach ($atts as $tab) { $tab_id = "tab-" . $i++; $output .= '<li><a href="#' . $tab_id . '" class="tab">' .$tab. '</a></li>'; } $output .= '<li class="clear"></li></ul>'; $output .= do_shortcode($content) .'</div>'; return $output; } add_shortcode('tabs', 'tabbed_asset'); // Setup a global int variable to enable unique tab identities $t = 0; function tabbed_tab( $atts, $content = null ) { global $t; extract(shortcode_atts(array(), $atts)); $tab_id = "tab-" . $t++; $output = '<div id="' . $tab_id . '" class="tab-content">' . do_shortcode($content) .'</div>'; return $output; } add_shortcode('tab', 'tabbed_tab'); /* TABLE SHORTCODES ================================================= */ function table_wrap( $atts, $content = null ) { extract(shortcode_atts(array( "type" => '' ), $atts)); $output = '<table class="sf-table '.$type.'"><tbody>'; $output .= do_shortcode($content) .'</tbody></table>'; return $output; } add_shortcode('table', 'table_wrap'); function table_row( $atts, $content = null ) { $output = '<tr>'; $output .= do_shortcode($content) .'</tr>'; return $output; } add_shortcode('trow', 'table_row'); function table_column( $atts, $content = null ) { $output = '<td>'; $output .= do_shortcode($content) .'</td>'; return $output; } add_shortcode('tcol', 'table_column'); function table_head( $atts, $content = null ) { $output = '<th>'; $output .= do_shortcode($content) .'</th>'; return $output; } add_shortcode('thcol', 'table_head'); /* PRICING TABLE SHORTCODES ================================================= */ function pt_wrap( $atts, $content = null ) { extract(shortcode_atts(array( "type" => '', "columns" => '' ), $atts)); $output = '<div class="pricing-table-wrap '.$type.' columns-'. $columns .'">' . do_shortcode($content) .'</div>'; return $output; } add_shortcode('pricing_table', 'pt_wrap'); function pt_column( $atts, $content = null ) { extract(shortcode_atts(array( "highlight" => '' ), $atts)); if ($highlight == "yes") { $output = '<div class="pricing-table-column column-highlight">' . do_shortcode($content) .'</div>'; } else { $output = '<div class="pricing-table-column">' . do_shortcode($content) .'</div>'; } return $output; } add_shortcode('pt_column', 'pt_column'); function pt_price( $atts, $content = null ) { $output = '<div class="pricing-table-price">' . do_shortcode($content) .'</div>'; return $output; } add_shortcode('pt_price', 'pt_price'); function pt_package( $atts, $content = null ) { $output = '<div class="pricing-table-package">' . do_shortcode($content) .'</div>'; return $output; } add_shortcode('pt_package', 'pt_package'); function pt_details( $atts, $content = null ) { $output = '<div class="pricing-table-details">' . do_shortcode($content) .'</div>'; return $output; } add_shortcode('pt_details', 'pt_details'); function pt_button( $atts, $content = null ) { extract(shortcode_atts(array( "link" => "#", "target" => '_self' ), $atts)); $output = '<br/>'.do_shortcode('[button link="'.$link.'" target="'.$target.'" type="slightlyroundedarrow" colour="accent"]' . $content .'[/button]'); return $output; } add_shortcode('pt_button', 'pt_button'); /* LABELLED PRICING TABLE SHORTCODES ================================================= */ function lpt_wrap( $atts, $content = null ) { extract(shortcode_atts(array( "columns" => '' ), $atts)); $output = '<div class="pricing-table-wrap labelled-pricing-table columns-'. $columns .'">' . do_shortcode($content) .'</div>'; return $output; } add_shortcode('labelled_pricing_table', 'lpt_wrap'); function lpt_label_column( $atts, $content = null ) { $output = '<div class="pricing-table-column label-column">' . do_shortcode($content) .'</div>'; return $output; } add_shortcode('lpt_label_column', 'lpt_label_column'); function lpt_column( $atts, $content = null ) { extract(shortcode_atts(array( "highlight" => '' ), $atts)); if ($highlight == "yes") { $output = '<div class="pricing-table-column column-highlight">' . do_shortcode($content) .'</div>'; } else { $output = '<div class="pricing-table-column">' . do_shortcode($content) .'</div>'; } return $output; } add_shortcode('lpt_column', 'lpt_column'); function lpt_price( $atts, $content = null ) { $output = '<div class="pricing-table-price">' . do_shortcode($content) .'</div>'; return $output; } add_shortcode('lpt_price', 'lpt_price'); function lpt_package( $atts, $content = null ) { $output = '<div class="pricing-table-package">' . do_shortcode($content) .'</div>'; return $output; } add_shortcode('lpt_package', 'pt_package'); function lpt_row_label( $atts, $content = null ) { extract(shortcode_atts(array( "alt" => "", ), $atts)); if ($alt == "yes") { $output = '<div class="pricing-table-label-row alt-row">' . do_shortcode($content) .'</div>'; } else { $output = '<div class="pricing-table-label-row">' . do_shortcode($content) .'</div>'; } return $output; } add_shortcode('lpt_row_label', 'lpt_row_label'); function lpt_row( $atts, $content = null ) { extract(shortcode_atts(array( "alt" => "", ), $atts)); if ($alt == "yes") { $output = '<div class="pricing-table-row alt-row">' . do_shortcode($content) .'</div>'; } else { $output = '<div class="pricing-table-row">' . do_shortcode($content) .'</div>'; } return $output; } add_shortcode('lpt_row', 'lpt_row'); function lpt_button( $atts, $content = null ) { extract(shortcode_atts(array( "link" => "#", "target" => '_self' ), $atts)); $output = '<div class="lpt-button-wrap">'.do_shortcode('[button link="'.$link.'" target="'.$target.'" type="slightlyroundedarrow" colour="accent"]' . $content .'[/button]</div>'); return $output; } add_shortcode('lpt_button', 'lpt_button'); /* TYPOGRAPHY SHORTCODES ================================================= */ // Highlight Text function highlighted($atts, $content = null) { return '<span class="highlighted">'. do_shortcode($content) .'</span>'; } add_shortcode("highlight", "highlighted"); // Decorative Ampersand function decorative_ampersand($atts, $content = null) { return '<span class="decorative-ampersand">&</span>'; } add_shortcode("decorative_ampersand", "decorative_ampersand"); // Dropcap type 1 function dropcap1($atts, $content = null) { return '<span class="dropcap1">'. do_shortcode($content) .'</span>'; } add_shortcode("dropcap1", "dropcap1"); // Dropcap type 2 function dropcap2($atts, $content = null) { return '<span class="dropcap2">'. do_shortcode($content) .'</span>'; } add_shortcode("dropcap2", "dropcap2"); // Dropcap type 3 function dropcap3($atts, $content = null) { return '<span class="dropcap3">'. do_shortcode($content) .'</span>'; } add_shortcode("dropcap3", "dropcap3"); // Dropcap type 4 function dropcap4($atts, $content = null) { return '<span class="dropcap4">'. do_shortcode($content) .'</span>'; } add_shortcode("dropcap4", "dropcap4"); // Blockquote type 1 function blockquote1($atts, $content = null) { return '<blockquote class="blockquote1">'. do_shortcode($content) .'</blockquote>'; } add_shortcode("blockquote1", "blockquote1"); // Blockquote type 2 function blockquote2($atts, $content = null) { return '<blockquote class="blockquote2">'. do_shortcode($content) .'</blockquote>'; } add_shortcode("blockquote2", "blockquote2"); // Blockquote type 3 function blockquote3($atts, $content = null) { return '<blockquote class="blockquote3">'. do_shortcode($content) .'</blockquote>'; } add_shortcode("blockquote3", "blockquote3"); // Blockquote type 4 function pullquote($atts, $content = null) { return '<blockquote class="pullquote">'. do_shortcode($content) .'</blockquote>'; } add_shortcode("pullquote", "pullquote"); /* LISTS SHORTCODES ================================================= */ function sf_list( $atts, $content = null ) { extract(shortcode_atts(array( "type" => '' ), $atts)); $output = '<ul class="sf-list list-'.$type.'">' . do_shortcode($content) .'</ul>'; return $output; } add_shortcode('list', 'sf_list'); function sf_list_item( $atts, $content = null ) { $output = '<li>' . do_shortcode($content) .'</li>'; return $output; } add_shortcode('list_item', 'sf_list_item'); /* DIVIDER SHORTCODE ================================================= */ function horizontal_break($atts, $content = null) { return '<div class="horizontal-break"> </div>'; } add_shortcode("hr", "horizontal_break"); /* MAP SHORTCODE ================================================= */ function fn_googleMaps($atts, $content = null) { extract(shortcode_atts(array( "width" => '1170', "height" => '400', "src" => '' ), $atts)); return '<div class="map"><iframe width="'.$width.'" height="'.$height.'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'.$src.'&output=embed&iwloc=near"></iframe></div>'; } add_shortcode("map", "fn_googleMaps"); /* SOCIAL SHORTCODE ================================================= */ function social_icons($atts, $content = null) { extract(shortcode_atts(array( "type" => '', "size" => 'standard', "style" => 'colour' ), $atts)); $options = get_option('sf_neighborhood_options'); $twitter = $options['twitter_username']; $facebook = $options['facebook_page_url']; $dribbble = $options['dribbble_username']; $vimeo = $options['vimeo_username']; $tumblr = $options['tumblr_username']; $spotify = $options['spotify_username']; $skype = $options['skype_username']; $linkedin = $options['linkedin_page_url']; $lastfm = $options['lastfm_username']; $googleplus = $options['googleplus_page_url']; $flickr = $options['flickr_page_url']; $youtube = $options['youtube_username']; $behance = $options['behance_username']; $pinterest = $options['pinterest_username']; $instagram = $options['instagram_username']; $yelp = $options['yelp_url']; $xing = ""; if (isset($options['xing_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">Twitter</a></li>'."\n"; } if ($facebook) { $social_icons .= '<li class="facebook"><a href="'.$facebook.'" target="_blank">Facebook</a></li>'."\n"; } if ($dribbble) { $social_icons .= '<li class="dribbble"><a href="http://www.dribbble.com/'.$dribbble.'" target="_blank">Dribbble</a></li>'."\n"; } if ($vimeo) { $social_icons .= '<li class="vimeo"><a href="http://www.vimeo.com/'.$vimeo.'" target="_blank">Vimeo</a></li>'."\n"; } if ($tumblr) { $social_icons .= '<li class="tumblr"><a href="http://'.$tumblr.'.tumblr.com/" target="_blank">Tumblr</a></li>'."\n"; } if ($spotify) { $social_icons .= '<li class="spotify"><a href="http://open.spotify.com/user/'.$spotify.'" target="_blank">Spotify</a></li>'."\n"; } if ($skype) { $social_icons .= '<li class="skype"><a href="skype:'.$skype.'" target="_blank">Skype</a></li>'."\n"; } if ($linkedin) { $social_icons .= '<li class="linkedin"><a href="'.$linkedin.'" target="_blank">LinkedIn</a></li>'."\n"; } if ($lastfm) { $social_icons .= '<li class="lastfm"><a href="http://www.last.fm/user/'.$lastfm.'" target="_blank">Last.fm</a></li>'."\n"; } if ($googleplus) { $social_icons .= '<li class="googleplus"><a href="'.$googleplus.'" target="_blank">Google+</a></li>'."\n"; } if ($flickr) { $social_icons .= '<li class="flickr"><a href="'.$flickr.'" target="_blank">Flickr</a></li>'."\n"; } if ($youtube) { $social_icons .= '<li class="youtube"><a href="'.$youtube.'" target="_blank">YouTube</a></li>'."\n"; } if ($behance) { $social_icons .= '<li class="behance"><a href="http://www.behance.net/'.$behance.'" target="_blank">Behance</a></li>'."\n"; } if ($pinterest) { $social_icons .= '<li class="pinterest"><a href="http://www.pinterest.com/'.$pinterest.'/" target="_blank">Pinterest</a></li>'."\n"; } if ($instagram) { $social_icons .= '<li class="instagram"><a href="http://instagram.com/'.$instagram.'" target="_blank">Instagram</a></li>'."\n"; } if ($yelp) { $social_icons .= '<li class="yelp"><a href="'.$yelp.'/" target="_blank">Yelp</a></li>'."\n"; } if ($xing) { $social_icons .= '<li class="xing"><a href="'.$xing.'/" target="_blank">Xing</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">Twitter</a></li>'."\n"; } if ($id == "facebook") { $social_icons .= '<li class="facebook"><a href="'.$facebook.'" target="_blank">Facebook</a></li>'."\n"; } if ($id == "dribbble") { $social_icons .= '<li class="dribbble"><a href="http://www.dribbble.com/'.$dribbble.'" target="_blank">Dribbble</a></li>'."\n"; } if ($id == "vimeo") { $social_icons .= '<li class="vimeo"><a href="http://www.vimeo.com/'.$vimeo.'" target="_blank">Vimeo</a></li>'."\n"; } if ($id == "tumblr") { $social_icons .= '<li class="tumblr"><a href="http://'.$tumblr.'.tumblr.com/" target="_blank">Tumblr</a></li>'."\n"; } if ($id == "spotify") { $social_icons .= '<li class="spotify"><a href="http://open.spotify.com/user/'.$spotify.'" target="_blank">Spotify</a></li>'."\n"; } if ($id == "skype") { $social_icons .= '<li class="skype"><a href="skype:'.$skype.'" target="_blank">Skype</a></li>'."\n"; } if ($id == "linkedin") { $social_icons .= '<li class="linkedin"><a href="'.$linkedin.'" target="_blank">LinkedIn</a></li>'."\n"; } if ($id == "lastfm") { $social_icons .= '<li class="lastfm"><a href="http://www.last.fm/user/'.$lastfm.'" target="_blank">Last.fm</a></li>'."\n"; } if ($id == "googleplus") { $social_icons .= '<li class="googleplus"><a href="'.$googleplus.'" target="_blank">Google+</a></li>'."\n"; } if ($id == "flickr") { $social_icons .= '<li class="flickr"><a href="'.$flickr.'" target="_blank">Flickr</a></li>'."\n"; } if ($id == "youtube") { $social_icons .= '<li class="youtube"><a href="'.$youtube.'" target="_blank">YouTube</a></li>'."\n"; } if ($id == "behance") { $social_icons .= '<li class="behance"><a href="http://www.behance.net/'.$behance.'" target="_blank">Behance</a></li>'."\n"; } if ($id == "pinterest") { $social_icons .= '<li class="pinterest"><a href="http://www.pinterest.com/'.$pinterest.'/" target="_blank">Pinterest</a></li>'."\n"; } if ($id == "instagram") { $social_icons .= '<li class="instagram"><a href="http://instagram.com/'.$instagram.'" target="_blank">Instagram</a></li>'."\n"; } if ($id == "yelp") { $social_icons .= '<li class="yelp"><a href="'.$yelp.'" target="_blank">Yelp</a></li>'."\n"; } if ($id == "xing") { $social_icons .= '<li class="xing"><a href="'.$xing.'/" target="_blank">Xing</a></li>'."\n"; } } } $sound_cloud_url = 'http://soundcloud.com'; //put url of sound cloud $mix_cloud_url = ''; //put url of mix cloud $social_icons .= '<li class="soundcloud"><a href="'.$sound_cloud_url.'/" target="_blank"><img src="IMAGE_URL_OF_SOUNDCLOUD" alt="" width="16" height="16" /></a></li>'."\n"; $social_icons .= '<li class="mixcloud"><a href="'.$mix_cloud_url.'/" target="_blank"><img src="IMAGE_URL_OF_MIXCLOUD" alt="" width="16" height="16" /></a></li>'."\n"; $output .= $social_icons; $output .= '</ul>'."\n"; return $output; } add_shortcode("social", "social_icons"); /* SITEMAP SHORTCODE ================================================= */ function sf_sitemap($params = array()) { // default parameters extract(shortcode_atts(array( 'title' => 'Site map', 'id' => 'sitemap', 'depth' => 2 ), $params)); // create sitemap $sitemap = '<div class="sitemap-wrap clearfix">'; $sitemap .= '<div class="sitemap-col">'; $sitemap .= '<h3>'.__("Pages", "swiftframework").'</h3>'; $page_list = wp_list_pages("title_li=&depth=$depth&sort_column=menu_order&echo=0"); if ($page_list != '') { $sitemap .= '<ul>'.$page_list.'</ul>'; } $sitemap .= '</div>'; $sitemap .= '<div class="sitemap-col">'; $sitemap .= '<h3>'.__("Posts", "swiftframework").'</h3>'; $post_list = wp_get_archives('type=postbypost&limit=20&echo=0'); if ($post_list != '') { $sitemap .= '<ul>'.$post_list.'</ul>'; } $sitemap .= '</div>'; $sitemap .= '<div class="sitemap-col">'; $sitemap .= '<h3>'.__("Categories", "swiftframework").'</h3>'; $category_list = wp_list_categories('sort_column=name&title_li=&depth=1&number=10&echo=0'); if ($category_list != '') { $sitemap .= '<ul>'.$category_list.'</ul>'; } $sitemap .= '<h3>'.__("Archives", "swiftframework").'</h3>'; $archive_list = wp_get_archives('type=monthly&limit=12&echo=0'); if ($archive_list != '') { $sitemap .= '<ul>'.$archive_list.'</ul>'; } $sitemap .= '</div>'; $sitemap .= '</div>'; return $sitemap; } add_shortcode('sf_sitemap', 'sf_sitemap'); /* SERVICES PROGRESS BAR SHORTCODE ================================================= */ function progress_bar($atts) { extract(shortcode_atts(array( "percentage" => '', "name" => '', "type" => '', "value" => '', "colour" => '' ), $atts)); if ($type == "") { $type = "standard"; } $service_bar_output = ''; $service_bar_output .= '<div class="progress '.$type.'">'. "\n"; if ($colour != "") { $service_bar_output .= '<div class="bar" data-value="'.$percentage.'" style="background-color:'.$colour.'!important;">'. "\n"; } else { $service_bar_output .= '<div class="bar" data-value="'.$percentage.'">'. "\n"; } $service_bar_output .= '<div class="bar-text">'.$name.' <span>'.$value.'</span></div>'. "\n"; $service_bar_output .= '</div>'. "\n"; $service_bar_output .= '</div>'. "\n"; global $has_progress_bar; $has_progress_bar = true; return $service_bar_output; } add_shortcode('progress_bar', 'progress_bar'); /* CHART SHORTCODE ================================================= */ function chart($atts) { extract(shortcode_atts(array( "percentage" => '50', "size" => '70', "barcolour" => '', "trackcolour" => '', "content" => '', "align" => '' ), $atts)); $chart_output = $linewidth = ''; if ($barcolour == "") { $barcolour = get_option('accent_color', '#fb3c2d'); } if ($trackcolour == "") { $trackcolour = '#f2f2f2'; } if ($size == "70") { $linewidth = "6"; } if ($size == "170") { $linewidth = "12"; } $chart_output .= '<div class="chart-shortcode chart-'.$size.' chart-'.$align.'" data-linewidth="'.$linewidth.'" data-percent="0" data-animatepercent="'.$percentage.'" data-size="'.$size.'" data-barcolor="'.$barcolour.'" data-trackcolor="'.$trackcolour.'">'; if ($content != "") { if (strpos($content, 'fa') !== false) { $chart_output .= '<span><i class="'.$content.'"></i></span>'; } else { $chart_output .= '<span>'.$content.'</span>'; } } $chart_output .= '</div>'; global $has_chart; $has_chart = true; return $chart_output; } add_shortcode('chart', 'chart'); /* TOOLTIP SHORTCODE ================================================= */ function tooltip($atts, $content = null) { extract(shortcode_atts(array( "title" => '', "link" => '#', "direction" => 'top' ), $atts)); $tooltip_output = '<a href="'.$link.'" rel="tooltip" data-original-title="'.$title.'" data-placement="'.$direction.'">'.do_shortcode($content).'</a>'; return $tooltip_output; } add_shortcode('sf_tooltip', 'tooltip'); /* MODAL SHORTCODE ================================================= */ function modal($atts, $content = null) { extract(shortcode_atts(array( "header" => '', "btn_type" => '', "btn_colour" => '', "btn_size" => '', "btn_text" => '' ), $atts)); global $modalCount; if ($modalCount >= 0) { $modalCount++; } else { $modalCount = 0; } $modal_output = ""; if (($btn_type == "squarearrow") || ($btn_type == "slightlyroundedarrow") || ($btn_type == "roundedarrow")) { $modal_output .= '<a class="sf-button '.$btn_size.' '. $btn_colour .' '. $btn_type .'" href="#modal-'.$modalCount.'" role="button" data-toggle="modal"><span>'. $btn_text .'</span><span class="arrow"></span></a>'; } else { $modal_output .= '<a class="sf-button '.$btn_size.' '. $btn_colour .' '. $btn_type .'" href="#modal-'.$modalCount.'" role="button" data-toggle="modal"><span>'. $btn_text .'</span></a>'; } $modal_output .= '<div id="modal-'.$modalCount.'" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="'.$header.'" aria-hidden="true"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h3 id="modal-label">'.$header.'</h3> </div> <div class="modal-body"> '.do_shortcode($content).' </div> </div>'; return $modal_output; } add_shortcode('sf_modal', 'modal'); /* RESPONSIVE VISIBILITY SHORTCODE ================================================= */ function visibility($atts, $content = null) { extract(shortcode_atts(array( "class" => '' ), $atts)); $visibility_output = '<div class="'.$class.'">'.do_shortcode($content).'</div>'; return $visibility_output; } add_shortcode('sf_visibility', 'visibility'); /* YEAR SHORTCODE ================================================= */ function year_shortcode() { $year = date('Y'); return $year; } add_shortcode('the-year', 'year_shortcode'); /* WORDPRESS LINK SHORTCODE ================================================= */ function wordpress_link() { return '<a href="http://wordpress.org/" target="_blank">WordPress</a>'; } add_shortcode('wp-link', 'wordpress_link'); ?>
April 1, 2014 at 3:40 pm #63282Hi,
Please replace line 30 with return $init to remove this error .Thanks 🙂
With Best Regards
Swift IdeasApril 1, 2014 at 3:47 pm #63286Hi Mohammad, i replaced the line 30 with “return $init” but im still getting a error —
Parse error: syntax error, unexpected ‘}’ in /home/cruelvap/public_html/fatfridge.co.uk/wp-content/themes/neighborhood/includes/swift-framework/shortcodes.php on line 31
April 1, 2014 at 3:51 pm #63287ive uploaded my shortcode.php–could you have a look what i done wrong please.
Many thanks
BradleyApril 1, 2014 at 4:01 pm #63292HI,
You are missing semicolon ; after return $init .
Thanks 🙂
With Best Regards
Swift IdeasApril 1, 2014 at 4:07 pm #63294hi mohammad, that worked thanks…but know the top social header is looking a bit messed up??
please visit – http://fatfridge.co.uk to see what i mean.April 1, 2014 at 4:08 pm #63297just realised that all the rollover effects have stopped and the blogsection has dissapeared?
April 1, 2014 at 4:14 pm #63305Hi,
Please provide wordpress admin login detail so i can try to fix the issue .
Thanks 🙂
With Best Regards
Swift IdeasApril 1, 2014 at 4:16 pm #63308This reply has been marked as private.April 1, 2014 at 4:47 pm #63342Hi,
I have resolved it and you need to upload two icons of size 16×16 for sound cloud and mixcloud through Admin -> Media -> Add New . After this i will let you you know .
ThanksApril 1, 2014 at 4:53 pm #63348thanks Mohammad!
still got the problem with the blog not showing and the roll over effects on everything?thanks for your help..much appreciated!
bradley -
Posted in: Neighborhood
You must be logged in and have valid license to reply to this topic.