日韩伦理亚洲欧美在线一区_免费看一级大片_在线观看视频一区二区_日韩大片高清播放器大全






    最近給雋永東方官網(wǎng)加載了HTTPS加密,隨之帶來了一些問題無法解決,比如以前加入的百度分享失效了,不支持HTTPS下的社會化分享,然后轉(zhuǎn)而繼續(xù)嘗試 addthis.com 但是發(fā)覺會自動載入graph.facebook.com 這種會嚴重拖慢速度的資源,后來又嘗試了大陸抄襲addthis.com的jiathis.com,發(fā)覺還是坑爹的不支持https,最后徹底放棄了第三方工具,尋求自己搭建的本地化方案,花了點時間整理了一份不錯的代碼,不敢獨享,分享給大家,如下:

    <?php
    $thumb_t = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'thumbnail' );
    $thumb_url_t = $thumb_t['0']; 
    $permalink = urlencode(get_permalink($post->ID));
    $title = urlencode($post->post_title);
    $title = str_replace('+','%20',$title);
    $sitename="雋永東方設計工作室";
    $domainurl="https://www.eastdesign.net";
    ?>
    <p><i class="fa fa-share-alt fa-2x"></i> &nbsp; <a class="sina-icon" title="分享到新浪微博" href="javascript:void((function(s,d,e,r,l,p,t,z,c){var%20f='http://v.t.sina.com.cn/share/share.php?appkey=',u=z||d.location,p=['&url=',e(u),'&title=',e(t||d.title),'&source=',e(r),'&sourceUrl=',e(l),'&content=',c||'gb2312','&pic=',e(p||'')].join('');function%20a(){if(!window.open([f,p].join(''),'mb',['toolbar=0,status=0,resizable=1,width=440,height=430,left=',(s.width-440)/2,',top=',(s.height-430)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();})(screen,document,encodeURIComponent,'','','<?php echo $thumb_url_t; ?>','<?php echo $title;?>','<?php echo $permalink; ?>','utf-8'));"><i class="fa fa-weibo fa-2x"></i></a> &nbsp; <a title="分享到QQ空間" href="javascript:void((function(s,d,e,r,l,p,t,z,c){var%20f='http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?',u=z||d.location,p=['url=',e(u),'&title=',e(t||d.title),'&source=',e(r),'&sourceUrl=',e(l),'&content=',c||'gb2312','&pic=',e(p||'')].join('');function%20a(){if(!window.open([f,p].join(''),'mb',['toolbar=0,status=0,resizable=1,width=550,height=540,left=',(s.width-550)/2,',top=',(s.height-540)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();})(screen,document,encodeURIComponent,'','','<?php echo $thumb_url_t; ?>','<?php echo $title;?>','<?php echo $permalink; ?>','utf-8'));"><i class="fa fa-qq fa-2x"></i></a> &nbsp; <a class="wechat-icon" title="分享到微信朋友圈" href="javascript:void((function(s,d,e,r,l,p,t,z,c){var%20f='http://s.jiathis.com/qrcode.php?',u=z||d.location,p=['url=',e(u),'&title=',e(t||d.title),'&source=',e(r),'&sourceUrl=',e(l),'&content=',c||'gb2312','&pic=',e(p||'')].join('');function%20a(){if(!window.open([f,p].join(''),'mb',['toolbar=0,status=0,resizable=1,width=140,height=140,left=',(s.width-140)/2,',top=',(s.height-140)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();})(screen,document,encodeURIComponent,'','','<?php echo $thumb_url_t; ?>','<?php echo $title;?>','<?php echo $permalink; ?>','utf-8'));"><i class="fa fa-wechat fa-2x"></i></a> </p>

    將以上代碼存成比如social-share.php并放入當前主題目錄,然后通過以下代碼調(diào)用到single.php這類詳情頁面:

    <?php include(TEMPLATEPATH . "/wechat-share.php"); ?>

    打開前臺實際測試一下效果如下:

    Social-share1Social-share2

    效果有點簡陋,不過因為沒載入任何圖片,采用了 fontawesome 的字體圖片,微信二維碼生成使用了?http://s.jiathis.com/qrcode.php ,速度挺快的,當然如果是英文類的國外站點,還是直接建議啟用addthis.com,效果很好,同時還支持Responsive,有詳細的分享統(tǒng)計報告。

    ? ? ? ? ? ? ? ? ? ? ? ?

    我們將在一個工作日內(nèi)聯(lián)系您

    ? ? ? ? ? ? ? ? ? ? ? ?

    免費診斷您的獨立站及產(chǎn)品搜索量,制定您的海外營銷計劃

    蕉岭县| 仁布县| 西昌市| 花垣县| 屯留县| 台安县| 张家口市| 宜阳县| 濮阳市| 莆田市| 常山县| 北流市| 南皮县| 南召县| 兰考县| 湖口县| 内乡县| 武汉市| 宁国市| 娱乐| 唐河县| 荃湾区| 福清市| 沧州市| 红安县| 沁源县| 视频| 甘孜县| 壶关县| 镇雄县| 明光市| 罗源县| 宝山区| 万宁市| 武功县| 洛隆县| 吐鲁番市| 嘉峪关市| 渝中区| 新晃| 东兰县|