- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
WordPress. How to add a new social icon to the social shortcode (based on Cherry Framework 3.x)
April 15, 2015
This tutorial shows how to add a new social icon to the social shortcode in WordPress (based on Cherry Framework).
WordPress. How to add a new social icon to the social shortcode (based on Cherry Framework)
You should check if the social icons were created with the help of the shortcode.
In order to do that, please check the desired page under pages – all pages and in text mode find the following shortcode [social facebook_url=”#” twitter_url=”#” google_plus_url=”#”]:
In order to add a new social icon to the social shortcode, you should perform the following:
-
Find the file with the shortcode on your server.
It will be in custom-function.php file located in wp-content/themes/themeXXXX/includes folder.
-
Open the file to edit with any code editor like Adobe Dreamweaver 8+, Notepad++ or any other editor.
-
Locate the following code in the file:
function social_shortcode($atts, $content = null) { extract(shortcode_atts(array( 'facebook_url' => '', 'twitter_url' => '', 'google_plus_url' => '', 'custom_class' => '', ), $atts));
-
Copy the line of code with the one of social icons and paste it under the existing social icons code to the new line below.
-
Correct the values in the code:
'linked_in_url' => '',
-
Locate the following code in the file:
$output = '
'; -
Copy the line of code with the one of social icons and paste it under the existing social icons code to the new line.
-
Correct the values in the code:
$output .= '';
-
The icons are set with the help of iconic font- Font Awesome. To find the desired icon you will need to follow this link.
-
Locate the desired icon.
-
Copy its class:
-
Paste the class into the following part of the social icon code:
class="icon-google-plus"
-
Save changes in the file.
-
Now you should add the created icon to the shortcode to make it display on the site.
-
In order to do that, please check the desired page under Pages->All pages and in text mode find the following shortcode [social facebook_url=”#” twitter_url=”#” google_plus_url=”#”] :
-
Copy the code of the existing social icon.
-
Paste it next to the last icon, right before the end of the shortcode.
-
Correct values in the copied code:
linked_in_url="#"
-
Save changes.
Feel free to check the detailed video tutorial below:
WordPress. How to add a new social icon to the social shortcode (based on Cherry Framework)