markdown 添加社交分享 - AddThis社交分享按钮

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 添加社交分享 - AddThis社交分享按钮相关的知识,希望对你有一定的参考价值。

# Notes
WordPress.org Plugin Page: https://wordpress.org/plugins/instagram-feed/

4/18/19 AU site
1. Must have an AddThis account at https://www.addthis.com/dashboard
2. Login to your account to get the pubid XXX (replace in code).
//* Add AddThis Social Share Buttons
add_action( 'et_after_main_content', 'jennywren_add_this_social_share' );
function jennywren_add_this_social_share() {
	if( is_singular( 'post') ) {
		echo '<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-XXXXXXXXXXXXXXXX"></script><div class="addthis_sharing_toolbox"></div>';
	}
}
/* Plugin - AddThis Social Share 
-------------------------------------------------------------------------------- */

.addthis_sharing_toolbox {
	width: 80%;
	max-width: 1080px;
	margin: auto;
}
[ file under: Notes ]

## Social Share (AddThis)
*Add social share buttons on individual blog posts only*

Code in:
- Appearance > Editor > functions.php

Settings in:
- AddThis options: https://www.addthis.com/dashboard

Why not a plugin?
- We do NOT use the WP plugin because it automatically loads scripts and styles on every page of the website, affecting page speed.
 
Why not add the code to Divi Theme Options?
- We do NOT use the code integration options in Divi Theme Options because it adds the code to both individual news posts and individual staff member posts.

Code Documentation:
- GitHub: https://gist.github.com/JennyWren/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
- Cacher: https://snippets.cacher.io/snippet/XXXXXXXXXXXXXXXXXXXXXXX

以上是关于markdown 添加社交分享 - AddThis社交分享按钮的主要内容,如果未能解决你的问题,请参考以下文章

如何在 phonegap 中添加社交分享按钮

如何在静态网站上添加社交分享按钮?

如何在 Angular 4 中添加社交分享按钮

django 社交分享按钮图标

Winjs 应用程序中的社交分享

如何在每个 WordPress 帖子图像周围添加 div 并检索悬停图像以进行社交共享?