Betheme加入国内社交化分享完美攻略(修改后亲测有效)

betheme主题的社交化功能比较尴尬,分享到国外的utobe,脸书等网站,可是这些网站在国内基本打不开呀,所以就成为了鸡肋功能,也有一些国内主题发布网站修改了这一块,但是好多都有问题,还是自己动手丰衣足食吧,铬元素来分享一下现版本比较有效的办法,先来看一下最终效果:

1 先来把制作好的css文件以及用到的图标分享给大家:链接:https://pan.baidu.com/s/1mkQsq64VX5LzmlugdDS5mg       提取码:x4ay

下载好文件以后,打开,放在/fonts目录。

2   mfn-icons-add.css放在/fonts目录,后台设置面板用,icons-add.css放在/css目录,前台用;

 

3 引入css文件

后台设置引入,修改/muffin-options/options.php文件,大概在160行,版本变动,可以搜索_enqueue()函数,将红色的复制添加

wp_enqueue_style( ‘mfn-opts-icons’, THEME_URI. ‘/fonts/mfn-icons.css’, false, time(), ‘all’);
wp_enqueue_style( ‘mfn-opts-font’, ‘http’. mfn_ssl() .’://fonts.googleapis.com/css?family=Open+Sans:400,400italic,600′ );
//新增社会化分享新增
wp_enqueue_style(‘mfn-opts-icons-add’, THEME_URI. ‘/fonts/mfn-icons-add.css’, false, time(), ‘all’);

4 前台页面引入,修改/functions/theme-head.php文件,在123行,在if( ! function_exists( ‘mfn_styles’ ) )中,依然是将红色代码复制添加:

if( ! isset( $theme_disable[‘entrance-animations’] ) ){
wp_enqueue_style( ‘mfn-animations’, THEME_URI .’/assets/animations/animations.min.css’, false, THEME_VERSION, ‘all’ );
}

wp_enqueue_style( ‘mfn-jquery-ui’, THEME_URI .’/assets/ui/jquery.ui.all.css’, false, THEME_VERSION, ‘all’ );
wp_enqueue_style( ‘mfn-jplayer’, THEME_URI .’/assets/jplayer/css/jplayer.blue.monday.css’, false, THEME_VERSION, ‘all’ );
//增加本地社会化分享
wp_enqueue_style(‘mfn-icons-add’, THEME_URI .’/css/icons-add.css’, false, THEME_VERSION, ‘all’);

5 后台图标框显示增加的图标,修改/muffin-options/fields/icon/field_icon.php文件,在423行后面添加自己增加的图标:

<?php
class MFN_Options_icon extends MFN_Options{

private $icons = array(

/* — 我的字体包增加的内容 —*/
‘icon-qzone’,
‘icon-tqq’,
‘icon-wechat’,
‘icon-bilibili’,
‘icon-douyin’,
‘icon-owelltube’,
‘icon-xuangu’,
‘icon-ar’,
‘icon-acfun’,
‘icon-lofter’,
‘icon-vr1’,
‘icon-vr2’,
‘icon-weishi’,
‘icon-iqiybg’,
‘icon-partner’,
‘icon-huaban’,
‘icon-knowledge’,
‘icon-kaixin’,
‘icon-kuaishou’,
‘icon-taobaobg’,
‘icon-vqq’,
‘icon-tqqbg’,
‘icon-team’,
‘icon-wangyi’,
‘icon-huoshan’,
‘icon-zcool’,
‘icon-commerce’,
‘icon-learning’,
‘icon-jdbg’,
‘icon-mibg’,
‘icon-alipay’,
‘icon-iqiy’,
‘icon-jd’,
‘icon-taobao’,
‘icon-mi’,
‘icon-owell’,
‘icon-youku’,

);

6 修改/muffin-options/theme-options.php文件,搜索$sections[‘social’] = array,在这个数组里加入红色部分代码:

array(
‘id’ => ‘social-rss’,
‘type’ => ‘switch’,
‘title’ => __(‘RSS’, ‘mfn-opts’),
‘desc’ => __(‘Show the RSS icon’, ‘mfn-opts’),
‘options’ => array(‘1’ => ‘On’,’0′ => ‘Off’),
‘std’ => ‘0’
),
array(
‘id’ => ‘social-weibo’,
‘type’ => ‘text’,
‘title’ => __(‘微博’, ‘mfn-opts’),
‘desc’ => __(‘Link to the profile page’, ‘mfn-opts’),
),
array(
‘id’ => ‘social-renren’,
‘type’ => ‘text’,
‘title’ => __(‘人人’, ‘mfn-opts’),
‘desc’ => __(‘Link to the profile page’, ‘mfn-opts’),
),
array(
‘id’ => ‘social-qq’,
‘type’ => ‘text’,
‘title’ => __(‘QQ’, ‘mfn-opts’),
‘desc’ => __(‘Link to the profile page’, ‘mfn-opts’),
),
array(
‘id’ => ‘social-wechat’,
‘type’ => ‘text’,
‘title’ => __(‘微信’, ‘mfn-opts’),
‘desc’ => __(‘Link to the profile page’, ‘mfn-opts’),
),
array(
‘id’ => ‘social-qzone’,
‘type’ => ‘text’,
‘title’ => __(‘QQ空间’, ‘mfn-opts’),
‘desc’ => __(‘Link to the profile page’, ‘mfn-opts’),
),
array(
‘id’ => ‘social-tqq’,
‘type’ => ‘text’,
‘title’ => __(‘腾讯微博’, ‘mfn-opts’),
‘desc’ => __(‘Link to the profile page’, ‘mfn-opts’),
),
array(
‘id’ => ‘social-bilibili’,
‘type’ => ‘text’,
‘title’ => __(‘哔哩哔哩’, ‘mfn-opts’),
‘desc’ => __(‘Link to the profile page’, ‘mfn-opts’),
),
array(
‘id’ => ‘social-youku’,
‘type’ => ‘text’,
‘title’ => __(‘优酷’, ‘mfn-opts’),
‘desc’ => __(‘Link to the profile page’, ‘mfn-opts’),
),
array(
‘id’ => ‘social-douyin’,
‘type’ => ‘text’,
‘title’ => __(‘抖音’, ‘mfn-opts’),
‘desc’ => __(‘Link to the profile page’, ‘mfn-opts’),
),
array(
‘id’ => ‘social-owell’,
‘type’ => ‘text’,
‘title’ => __(‘欧威创艺’, ‘mfn-opts’),
‘desc’ => __(‘Link to the profile page’, ‘mfn-opts’),
),
array(
‘id’ => ‘social-owelltube’,
‘type’ => ‘text’,
‘title’ => __(‘欧威影音’, ‘mfn-opts’),
‘desc’ => __(‘Link to the profile page’, ‘mfn-opts’),
),
array(
‘id’ => ‘social-xuangu’,
‘type’ => ‘text’,
‘title’ => __(‘玄谷’, ‘mfn-opts’),
‘desc’ => __(‘Link to the profile page’, ‘mfn-opts’),
),
array(
‘id’ => ‘social-iqiy’,
‘type’ => ‘text’,
‘title’ => __(‘爱奇艺’, ‘mfn-opts’),
‘desc’ => __(‘Link to the profile page’, ‘mfn-opts’),
),
array(
‘id’ => ‘social-vqq’,
‘type’ => ‘text’,
‘title’ => __(‘腾讯视频’, ‘mfn-opts’),
‘desc’ => __(‘Link to the profile page’, ‘mfn-opts’),
),
array(
‘id’ => ‘social-weishi’,
‘type’ => ‘text’,
‘title’ => __(‘微视’, ‘mfn-opts’),
‘desc’ => __(‘Link to the profile page’, ‘mfn-opts’),
),
array(
‘id’ => ‘social-taobao’,
‘type’ => ‘text’,
‘title’ => __(‘淘宝’, ‘mfn-opts’),
‘desc’ => __(‘Link to the profile page’, ‘mfn-opts’),
),
array(
‘id’ => ‘social-jd’,
‘type’ => ‘text’,
‘title’ => __(‘京东’, ‘mfn-opts’),
‘desc’ => __(‘Link to the profile page’, ‘mfn-opts’),
),
array(
‘id’ => ‘social-zcool’,
‘type’ => ‘text’,
‘title’ => __(‘站酷’, ‘mfn-opts’),
‘desc’ => __(‘Link to the profile page’, ‘mfn-opts’),
),

7 修改/includes/include-social.php文件,在12行,这个文件是对应图标的执行方法,你可以按自己的要求修改,比如我将微信的图标修改为鼠标悬停显示二维码,其他玩法就自己修改吧。

 

if( mfn_opts_get( ‘social-custom-icon’ ) && mfn_opts_get( ‘social-custom-link’ ) ){
echo ‘<li class=”custom”><a ‘.$target.’ href=”‘. esc_url( mfn_opts_get( ‘social-custom-link’ ) ) .'”><i class=”‘. esc_attr( mfn_opts_get( ‘social-custom-icon’ ) ) .'”></i></a></li>’;

if( mfn_opts_get(‘social-weibo’) ) echo ‘<li class=”weibo”><a ‘.$target.’ href=”‘. mfn_opts_get(‘social-weibo’) .'” title=”微博”><i class=”icon-weibo”></i></a></li>’;
if( mfn_opts_get(‘social-renren’) ) echo ‘<li class=”renren”><a ‘.$target.’ href=”‘. mfn_opts_get(‘social-renren’) .'” title=”人人”><i class=”icon-renren”></i></a></li>’;
if( mfn_opts_get(‘social-qq’) ) echo ‘<li class=”qq”><a ‘.$target.’ href=”‘. mfn_opts_get(‘social-qq’) .'” title=”QQ”><i class=”icon-qq”></i></a></li>’;
if( mfn_opts_get(‘social-wechat’) ) echo ‘<li class=”wechat”><a class=”tooltip tooltip-img” style=”cursor: pointer;border: 0px;”><span class=”tooltip-content” style=”width: 170px;bottom: 50px;left: 75px;”><img src=”‘. mfn_opts_get(‘social-wechat’) .'” alt=””></span><i class=”icon-wechat”></i></a></li>’;
if( mfn_opts_get(‘social-qzone’) ) echo ‘<li class=”qzone”><a ‘.$target.’ href=”‘. mfn_opts_get(‘social-qzone’) .'” title=”QQ空间”><i class=”icon-qzone”></i></a></li>’;
if( mfn_opts_get(‘social-tqq’) ) echo ‘<li class=”tqq”><a ‘.$target.’ href=”‘. mfn_opts_get(‘social-tqq’) .'” title=”腾讯微博”><i class=”icon-tqq”></i></a></li>’;
if( mfn_opts_get(‘social-bilibili’) ) echo ‘<li class=”bilibili”><a ‘.$target.’ href=”‘. mfn_opts_get(‘social-bilibili’) .'” title=”哔哩哔哩”><i class=”icon-bilibili”></i></a></li>’;
if( mfn_opts_get(‘social-douyin’) ) echo ‘<li class=”douyin”><a ‘.$target.’ href=”‘. mfn_opts_get(‘social-douyin’) .'” title=”抖音”><i class=”icon-douyin”></i></a></li>’;
if( mfn_opts_get(‘social-youku’) ) echo ‘<li class=”youku”><a ‘.$target.’ href=”‘. mfn_opts_get(‘social-youku’) .'” title=”优酷”><i class=”icon-youku”></i></a></li>’;
if( mfn_opts_get(‘social-owell’) ) echo ‘<li class=”owell”><a ‘.$target.’ href=”‘. mfn_opts_get(‘social-owell’) .'” title=”欧威创艺”><i class=”icon-owell”></i></a></li>’;
if( mfn_opts_get(‘social-owelltube’) ) echo ‘<li class=”owelltube”><a ‘.$target.’ href=”‘. mfn_opts_get(‘social-owelltube’) .'” title=”欧威影音”><i class=”icon-owelltube”></i></a></li>’;
if( mfn_opts_get(‘social-xuangu’) ) echo ‘<li class=”xuangu”><a ‘.$target.’ href=”‘. mfn_opts_get(‘social-xuangu’) .'” title=”玄谷”><i class=”icon-xuangu”></i></a></li>’;
if( mfn_opts_get(‘social-iqiy’) ) echo ‘<li class=”iqiy”><a ‘.$target.’ href=”‘. mfn_opts_get(‘social-iqiy’) .'” title=”爱奇艺”><i class=”icon-iqiy”></i></a></li>’;
if( mfn_opts_get(‘social-vqq’) ) echo ‘<li class=”vqq”><a ‘.$target.’ href=”‘. mfn_opts_get(‘social-vqq’) .'” title=”腾讯视频”><i class=”icon-vqq”></i></a></li>’;
if( mfn_opts_get(‘social-weishi’) ) echo ‘<li class=”weishi”><a ‘.$target.’ href=”‘. mfn_opts_get(‘social-weishi’) .'” title=”微视”><i class=”icon-weishi”></i></a></li>’;
if( mfn_opts_get(‘social-taobao’) ) echo ‘<li class=”taobao”><a ‘.$target.’ href=”‘. mfn_opts_get(‘social-taobao’) .'” title=”淘宝”><i class=”icon-taobao”></i></a></li>’;
if( mfn_opts_get(‘social-jd’) ) echo ‘<li class=”jd”><a ‘.$target.’ href=”‘. mfn_opts_get(‘social-jd’) .'” title=”京东”><i class=”icon-jd”></i></a></li>’;
if( mfn_opts_get(‘social-zcool’) ) echo ‘<li class=”zcool”><a ‘.$target.’ href=”‘. mfn_opts_get(‘social-zcool’) .'” title=”站酷”><i class=”icon-zcool”></i></a></li>’;

 

这样就修改完毕了,稍微麻烦一点哈,主要是这些改动文件寻找起来稍显麻烦,不过改过来后效果还是挺好的。分享给大家,转发请注明本攻略由石家庄网站设计铬元素工作室原创整理.

常见问题
所有的素材与插件都可以用吗?
本站所有的素材与插件(包括免费的),都是本工作室用过的,测试过的,或者二开修改过的,理论上来说没有什么bug,但不保证在所有环境下都可以完美运行。
收费素材与免费素材怎么定义的
本站收费的素材,也是及其便宜的,其实就是收个打赏钱,是工作室对这些插件的测试,整理,修复,优化的辛苦钱,并非开发插件的费用,原创插件或者模版收费稍贵一些。
出现问题了怎么办?
由于收费非常低,大部分都不超10元,所以并不提供售后服务,但您如果需要,可以联系我付费咨询,费用为50元/次/小时。如果是原创模版或者插件,可以免费为您指导。
原文链接:https://www.52gys.cn/3269.html,转载请注明出处。
0

评论0

没有账号?注册  忘记密码?