wordpress简捷按钮_如何在WordPress中添加Skype共享按钮

wordpress简捷按钮

Did you know that Skype has a share button? We didn’t either until a reader asked us for a tutorial on how to add the Skype share button in WordPress. Skype is one of the most popular communication apps in the world. In this article, we will show you how to easily add a Skype share button in WordPress.

您知道Skype有共享按钮吗? 直到读者要求我们提供有关如何在WordPress中添加Skype共享按钮的教程之前,我们都没有。 Skype是世界上最受欢迎的通信应用程序之一。 在本文中,我们将向您展示如何在WordPress中轻松添加Skype共享按钮。

Skype Share Button

First thing you need to do is install and activate Skype share plugin (see our beginner’s guide on how to install a WordPress plugin).

您需要做的第一件事是安装并激活Skype共享插件(请参阅有关如何安装WordPress插件的初学者指南)。

Upon activation, go to Settings » Skype share button page to configure the plugin.

激活后,转到设置»Skype共享按钮页面以配置插件。

Skype share button settings page

The first option is to enable the share button. You must check this box to enable the Skype share button on your WordPress site.

第一个选项是启用共享按钮。 您必须选中此框以启用WordPress网站上的Skype共享按钮。

Next, you need to choose a button size. Available sizes for the button are large share, small share, circle icon, and square icon.

接下来,您需要选择一个按钮大小。 该按钮的可用大小为大份额,小份额,圆形图标和正方形图标。

Lastly, you need to choose the location of the button. You can either choose to show it on top of the article, below the article, or both.

最后,您需要选择按钮的位置。 您可以选择将其显示在文章的顶部,文章的下方,或将两者都显示。

Skype share can automatically detect the language of your WordPress site. But if it doesn’t, then you can manually select the language.

Skype共享可以自动检测WordPress网站的语言。 但是,如果没有,则可以手动选择语言。

Don’t forget to click on the save changes button to store your settings.

不要忘记单击“保存更改”按钮来存储您的设置。

That’s all, you can now visit your website to see the Skype Share button in action.

就是这样,您现在可以访问您的网站以查看实际使用的Skype共享按钮。

preview of Skype share button
在WordPress模板中手动添加Skype共享 (Manually Add Skype Share in WordPress Template)

If you want to manually add this in your theme files, then you can follow the manual code instructions below.

如果要在主题文件中手动添加,则可以按照下面的手动代码说明进行操作。

First add the following script in the head section of your file. You can either do this by directly editing your header.php file or do it the proper way of adding scripts by using Enqueue scripts.

首先,在文件的头部添加以下脚本。 您可以通过直接编辑header.php文件来执行此操作,也可以使用Enqueue脚本以正确的方式添加脚本。


<script>
// Place this code in the head section of your HTML file 
(function(r, d, s) {
	r.loadSkypeWebSdkAsync = r.loadSkypeWebSdkAsync || function(p) {
		var js, sjs = d.getElementsByTagName(s)[0];
		if (d.getElementById(p.id)) { return; }
		js = d.createElement(s);
		js.id = p.id;
		js.src = p.scriptToLoad;
		js.onload = p.callback
		sjs.parentNode.insertBefore(js, sjs);
	};
	var p = {
		scriptToLoad: 'https://swx.cdn.skype.com/shared/v/latest/skypewebsdk.js',
		id: 'skype_web_sdk'
	};
	r.loadSkypeWebSdkAsync(p);
})(window, document, 'script');
</script>

After that add the following code in your single.php, loop.php, index.php, page.php, category.php, and archive.php as long as it is placed within the post loop.

之后,将以下代码添加到您的single.php,loop.php,index.php,page.php,category.php和archive.php中,只要将其放置在post循环中即可。


<div class='skype-share' data-href='<?php the_permalink(); ?>' data-lang='en-US' data-text='<?php the_title(); ?>' data-style='large' ></div>

You can change the data-style to large, small, circle, or square.

您可以将数据样式更改为大,小,圆形或正方形。

You can also change the language to your desire language.

您还可以将语言更改为所需的语言。

Basically, the code above will allow the user to share the individual post with the post title as the message.

基本上,以上代码将允许用户以帖子标题作为消息共享单个帖子。

We hope this article helped you add Skype share button on your WordPress site. You may also want to see our guide on how to how to add clickable phone numbers for smartphones in WordPress

我们希望本文能帮助您在WordPress网站上添加Skype共享按钮。 您可能还希望查看我们的指南,了解如何在WordPress中为智能手机添加可点击的电话号码

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在TwitterFacebook上找到我们。

翻译自: https://www.wpbeginner.com/wp-tutorials/how-to-add-the-skype-share-button-in-wordpress/

wordpress简捷按钮

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值