WordPress. 如何添加一个新的社会图标的社会短码(基于樱桃框架3.x)
April 15, 2015
本教程展示了如何添加一个新的 social icon to the social shortcode 在WordPress(基于 Cherry Framework).
WordPress. 如何添加一个新的社会图标的社会短码(基于樱桃框架)
您应该检查社交图标是否在控件的帮助下创建 shortcode.
为了做到这一点,请检查所需的页面下面 页面-所有页面 在文本模式下找到以下内容 shortcode [social facebook_url= " # " twitter_url= " # " google_plus_url= " # "]:
以便添加新的 social icon to the social shortcode,你应执行以下步骤:
-
找到文件 shortcode on your server.
It will be in custom-function.php file located in wp-content /主题/ themeXXXX /包括 folder.
-
打开文件以使用任何代码进行编辑 editor 比如adobedreamweaver 8+、notepad++或其他软件 editor.
-
在文件中找到以下代码:
函数social_shortcode($ ats, $content = null) { 提取(shortcode_atts(数组( 'facebook_url' => '', 'twitter_url' => '', 'google_plus_url' => '', 'custom_class' => '', ), $atts));
-
复制一行代码与社会图标之一,并将其粘贴到现有的社会图标代码下的新行.
-
更正代码中的值:
'linked_in_url' => '',
-
在文件中找到以下代码:
$output = '
'; -
复制一行代码与社会图标之一,并将其粘贴到现有的社会图标代码下的新行.
-
更正代码中的值:
$output .= '';
-
这些图标是在标志性字体的帮助下设置的-字体真棒. 要找到所需的图标,您将需要遵循此操作 link.
-
找到所需的图标.
-
Copy its class:
-
类的以下部分中粘贴类 social icon code:
类= " icon-google-plus "
-
将更改保存在文件中.
-
现在,您应该将创建的图标添加到 shortcode 让它显示在网站上.
-
为了做到这一点,请检查所需的页面下面 Pages->All pages 在文本模式下找到以下内容 shortcode [social facebook_url= " # " twitter_url= " # " google_plus_url= " # "] :
-
复制现有的代码 social icon.
-
将其粘贴到最后一个图标旁边,就在 shortcode.
-
复制代码中的正确值:
linked_in_url = " # "
-
Save changes.
请随时查看下面的详细视频教程: