ソーシャルボタンをGeeklogに追加する
- Thursday, December 31 2015 @ 10:11 AM JST
- 投稿者: Admin
- 表示回数 4,605
Geeklog にSocial buttonを追加する方法はこちら。
header.thtml:
<meta name="twitter:image:height" content="400"{xhtml}>
<meta name="twitter:image:width" content="500"{xhtml}>
<meta name="twitter:url" content="<?php echo htmlspecialchars(htmlspecialchars(COM_getCurrentURL(), ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'utf-8'); ?>"{xhtml}>
footer:
<script>window.twttr = (function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0],
t = window.twttr || {};
if (d.getElementById(id)) return t;
js = d.createElement(s);
js.id = id;
js.src = "https://platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js, fjs);
t._e = [];
t.ready = function(f) {
t._e.push(f);
};
return t;
}(document, "script", "twitter-wjs"));</script>
storytext.thtml, featuredstorytext.thtml
<ul class="uk-subnav uk-flex-right uk-margin-remove">
<li><g:plusone href="{site_url}/article.php/{story_id}"></g:plusone></li>
<li><a class="twitter-share-button" data-url="{site_url}/article.php/{story_id}" href="https://twitter.com/intent/tweet?text={story_title}" data-lang="ja">Tweet</a></li>
<li><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2F{!!autotag domain: !!}%2Farticle.php%2F{story_id}&width=150&height=20&colorscheme=light&layout=button_count&action=like&show_faces=true&send=true&appId={!!autotag conf:facebook_consumer_key !!}" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:150px; height:20px;" allowTransparency="true"></iframe></li>
</ul>
see more:
https://github.com/ivywe/Default/commit/81f6c0e8e95782d916f3f2f3cfd9098d7ce55b8f
https://github.com/ivywe/Default/commit/144634e42e9c42aff1cb5bcf83f08144c73bc268
Geeklog 2.1.1 Default theme download:
https://github.com/ivywe/Default
Twitter:
Autotags plugin: name domain: content example.com