Despite not really having much knowledge on html I've somewhat managed to arrange a Tumblr theme for a blog the way I want it thanks to tutorials online etc.
Only thing missing is I would like my posts to have a couple of social sharing buttons.
But following the tutorials I find online doesn't work, I believe it's because this theme is different and already has some buttons set (Tumblr reblog/like/etc)?
I have this code I created following a tutorial and grabbing some custom icons from deviantart.
{block:PermalinkPage}{block:PermalinkPagination}
<a target="_new" href="https://twitter.com/intent/tweet?text={URLEncodedTweetSummary}"><img style="border: 0pt none;" src="http://orig00.deviantart.net/8cf5/f/2016/316/5/8/twitter_icon_by_aquasparkles-dao40yu.png" width="20" height="20" /></a>
<a target="_new" href="https://www.facebook.com/sharer.php?u={Permalink}{block:Title}&t={Title}{/block:Title}"><img style="border: 0pt none;" src="http://orig10.deviantart.net/5fb3/f/2017/103/f/f/facebook_icon_by_aquasparkles-db5mtq8.png" width="20" height="20" /></a>
<a target="_new" href="http://pinterest.com/pin/create/button/?url={Permalink}&media={PhotoURL-500}"><img style="border: 0pt none;" src="http://orig03.deviantart.net/49e0/f/2016/181/3/4/pinterest_icon_by_aquasparkles-da86kds.png"> width="20" height="20" /></a>
{/block:PermalinkPagination}{/block:PermalinkPage}
But putting it before or at the end of {block:Posts} like the site suggests doesn't seem to work.
So I don't know what to do. Ideally it would be great if they could appear behind or after the other buttons already in the theme for every post, but I don't know where they are in the code. If that is too complicated to do, even just appearing under each post will be enough.
Tumblr lacks the relevant template tags when a share request is made from the index page.
Currently there are variables {PostTitle}
and {PostSummary}
, but these only rendered on the Permalink page.
The goal is to replicate the information Tumblr creates for the Facebook OG meta
tags (which is rendered on the permalink page). Although it is possible to generate the correct OG tags on the index page, this only provides support for Facebook, so other networks still need padding out.
For each post type we should generate and include, if possible, the following {Post}
information:
It is presumed your share urls will be inside the corresponding post type block. For sanity utilise: {Plaintext}
and {URLEncoded}
for creating strings.
Afaik this covers all post types. That being said, this is not a complete solution. Some things will be missing due to the nature of embeds (Videos / Audio I am looking at you here!).
If you find any problems fork / comment and I will do my best to assist.
{block:Title}{PlaintextTitle}{/block:Title}
{URLEncodedPermalink}
{PlaintextBody}
http://assets.tumblr.com/images/og/text_200.png
{block:Text}http://www.facebook.com/sharer/sharer.php?s=100&p[title]={block:Title}{PlaintextTitle}{/block:Title}&p[url]={URLEncodedPermalink}&p[images][0]=http://assets.tumblr.com/images/og/text_200.png&p[summary]={PlaintextBody}{/block:Text}
{block:Text}https://twitter.com/intent/tweet?text={block:Title}{PlaintextTitle}%20-%20{/block:Title}&url={URLEncodedPermalink}{/block:Text}
{block:Text}https://plus.google.com/share?url={URLEncodedPermalink}{/block:Text}
{block:Text}http://pinterest.com/pin/create/button/?url={URLEncodedPermalink}&description={block:Title}{PlaintextTitle}{/block:Title}&media=http://assets.tumblr.com/images/og/text_200.png{/block:Text}
{block:Text}http://reddit.com/submit?url={URLEncodedPermalink}&title={block:Title}{PlaintextTitle}{/block:Title}{/block:Text}
{PlaintextTitle}
{URLEncodedPermalink}
{block:Caption}{PlaintextCaption}{/block:Caption}
{URLEncodedPhotoURL-250}
{block:Photo}http://www.facebook.com/sharer/sharer.php?s=100&p[title]={PlaintextTitle}&p[url]={URLEncodedPermalink}&p[images][0]={URLEncodedPhotoURL-250}&p[summary]={block:Caption}{PlaintextCaption}{/block:Caption}{/block:Photo}
{block:Photo}https://twitter.com/intent/tweet?text={block:Caption}{PlaintextCaption}{/block:Caption}%20-%20&url={URLEncodedPermalink}{/block:Photo}
{block:Photo}https://plus.google.com/share?url={URLEncodedPermalink}{/block:Photo}
{block:Photo}http://pinterest.com/pin/create/button/?url={URLEncodedPermalink}&description={block:Caption}{PlaintextCaption}{/block:Caption}&media={URLEncodedPhotoURL-250}{/block:Photo}
{block:Photo}http://reddit.com/submit?url={URLEncodedPermalink}&title={block:Caption}{PlaintextCaption}{/block:Caption}{/block:Photo}
{PlaintextTitle}
{URLEncodedPermalink}
{block:Caption}{PlaintextCaption}{/block:Caption}
{block:Photos}{URLEncodedPhotoURL-250}{/block:Photos}
(* The last image in the set will be used) {block:Photoset}http://www.facebook.com/sharer/sharer.php?s=100&p[title]={PlaintextTitle}&p[url]={URLEncodedPermalink}{block:Photos}&p[images][0]={URLEncodedPhotoURL-250}{/block:Photos}&p[summary]={block:Caption}{PlaintextCaption}{/block:Caption}{/block:Photoset}
{block:Photoset}https://twitter.com/intent/tweet?text={block:Caption}{PlaintextCaption}{/block:Caption}%20-%20&url={URLEncodedPermalink}{/block:Photoset}
{block:Photoset}https://plus.google.com/share?url={URLEncodedPermalink}{/block:Photoset}
{block:Photoset}http://pinterest.com/pin/create/button/?url={URLEncodedPermalink}&description={block:Caption}{PlaintextCaption}{/block:Caption}{block:Photos}&media={URLEncodedPhotoURL-250}{/block:Photos}{/block:Photoset}
{block:Photoset}http://reddit.com/submit?url={URLEncodedPermalink}&title={block:Caption}{PlaintextCaption}{/block:Caption}{/block:Photoset}
{PlaintextQuote}
{URLEncodedPermalink}
http://assets.tumblr.com/images/og/quote_200.png
{block:Quote}http://www.facebook.com/sharer/sharer.php?s=100&p[title]={PlaintextQuote}&p[url]={URLEncodedPermalink}&p[images][0]=http://assets.tumblr.com/images/og/quote_200.png{/block:Quote}
{block:Quote}https://twitter.com/intent/tweet?text={PlaintextQuote}%20-%20&url={URLEncodedPermalink}{/block:Quote}
{block:Quote}https://plus.google.com/share?url={URLEncodedPermalink}{/block:Quote}
{block:Quote}http://pinterest.com/pin/create/button/?url={URLEncodedPermalink}&description={PlaintextQuote}&media=http://assets.tumblr.com/images/og/quote_200.png{/block:Quote}
{block:Quote}http://reddit.com/submit?url={URLEncodedPermalink}&title={PlaintextQuote}{/block:Quote}
{PlaintextName}
{URLEncodedPermalink}
{block:Description}{PlaintextDescription}{/block:Description}
http://assets.tumblr.com/images/og/link_200.png
{block:Link}http://www.facebook.com/sharer/sharer.php?s=100&p[title]={PlaintextName}&p[url]={URLEncodedPermalink}&p[images][0]=http://assets.tumblr.com/images/og/link_200.png&p[summary]={block:Description}{PlaintextDescription}{/block:Description}{/block:Link}
{block:Link}https://twitter.com/intent/tweet?text={PlaintextName}%20-%20&url={URLEncodedPermalink}{/block:Link}
{block:Link}https://plus.google.com/share?url={URLEncodedPermalink}{/block:Link}
{block:Link}http://pinterest.com/pin/create/button/?url={URLEncodedPermalink}&description={PlaintextName}&media=http://assets.tumblr.com/images/og/link_200.png{/block:Link}
{block:Link}http://reddit.com/submit?url={URLEncodedPermalink}&title={PlaintextName}{/block:Link}
{block:Title}{PlaintextTitle}{/block:Title}
{URLEncodedPermalink}
{block:Lines}{block:Label}{PlaintextLabel}{/block:Label}{PlaintextLine}%0A{/block:Lines}
http://assets.tumblr.com/images/og/link_200.png
{block:Chat}http://www.facebook.com/sharer/sharer.php?s=100&p[title]={block:Title}{PlaintextTitle}{/block:Title}&p[url]={URLEncodedPermalink}&p[images][0]=http://assets.tumblr.com/images/og/chat_200.png&p[summary]={block:Lines}{block:Label}{PlaintextLabel}{/block:Label}{PlaintextLine}%0A{/block:Lines}{/block:Chat}
{block:Chat}https://twitter.com/intent/tweet?text={block:Title}{PlaintextTitle}{/block:Title}%20-%20&url={URLEncodedPermalink}{/block:Chat}
{block:Chat}https://plus.google.com/share?url={URLEncodedPermalink}{/block:Chat}
{block:Chat}http://pinterest.com/pin/create/button/?url={URLEncodedPermalink}&description={block:Title}{PlaintextTitle}{/block:Title}&media=http://assets.tumblr.com/images/og/chat_200.png{/block:Chat}
{block:Chat}http://reddit.com/submit?url={URLEncodedPermalink}&title={block:Title}{PlaintextTitle}{/block:Title}{/block:Chat}
{block:TrackName}{PlaintextTrackname}{/block:TrackName}{block:Artist}%20-%20{PlaintextArtist}{/block:Artist}
{URLEncodedPermalink}
{block:Caption}{PlaintextCaption}{/block:Caption}
{block:AlbumArt}{URLEncodedAlbumArtURL}{/block:AlbumArt}
{block:Audio}http://www.facebook.com/sharer/sharer.php?s=100&p[title]={block:TrackName}{PlaintextTrackname}{/block:TrackName}{block:Artist}%20-%20{PlaintextArtist}{/block:Artist}&p[url]={URLEncodedPermalink}&p[images][0]={block:AlbumArt}{URLEncodedAlbumArtURL}{/block:AlbumArt}&p[summary]={block:Caption}{PlaintextCaption}{/block:Caption}{/block:Audio}
{block:Audio}https://twitter.com/intent/tweet?text={block:TrackName}{PlaintextTrackname}{/block:TrackName}{block:Artist}%20-%20{PlaintextArtist}{/block:Artist}%20%3A%20&url={URLEncodedPermalink}{/block:Audio}
{block:Audio}https://plus.google.com/share?url={URLEncodedPermalink}{/block:Audio}
{block:Audio}http://pinterest.com/pin/create/button/?url={URLEncodedPermalink}&description={block:TrackName}{PlaintextTrackname}{/block:TrackName}{block:Artist}%20-%20{PlaintextArtist}{/block:Artist}&media={block:AlbumArt}{URLEncodedAlbumArtURL}{/block:AlbumArt}{/block:Audio}
{block:Audio}http://reddit.com/submit?url={URLEncodedPermalink}&title={block:TrackName}{PlaintextTrackname}{/block:TrackName}{block:Artist}%20-%20{PlaintextArtist}{/block:Artist}{/block:Audio}
{PlaintextName}
{URLEncodedPermalink}
{block:Caption}{PlaintextCaption}{/block:Caption}
{block:VideoThumbnail}{VideoThumbnailURL}{/block:VideoThumbnail}
{block:Video}http://www.facebook.com/sharer/sharer.php?s=100&p[title]={PlaintextName}&p[url]={URLEncodedPermalink}&p[images][0]={block:VideoThumbnail}{VideoThumbnailURL}{/block:VideoThumbnail}&p[summary]={block:Caption}{PlaintextCaption}{/block:Caption}{/block:Video}
{block:Video}https://twitter.com/intent/tweet?text={block:Caption}{PlaintextCaption}{/block:Caption}%20-%20&url={URLEncodedPermalink}{/block:Video}
{block:Video}https://plus.google.com/share?url={URLEncodedPermalink}{/block:Video}
{block:Video}http://pinterest.com/pin/create/button/?url={URLEncodedPermalink}&description={block:Caption}{PlaintextCaption}{/block:Caption}&media={block:VideoThumbnail}{VideoThumbnailURL}{/block:VideoThumbnail}{/block:Video}
{block:Video}http://reddit.com/submit?url={URLEncodedPermalink}&title={block:Caption}{PlaintextCaption}{/block:Caption}{/block:Video}
{lang:Asker asked}%3A%0A{PlaintextQuestion}
{URLEncodedPermalink}
{PlaintextAnswer}
http://assets.tumblr.com/images/og/chat_200.png
{block:Answer}https://twitter.com/intent/tweet?text={lang:Asker asked}%3A%0A{PlaintextQuestion}%20-%20&url={URLEncodedPermalink}{/block:Answer}
{block:Answer}https://plus.google.com/share?url={URLEncodedPermalink}{/block:Answer}
{block:Answer}http://pinterest.com/pin/create/button/?url={URLEncodedPermalink}&description={lang:Asker asked}%3A%0A{PlaintextQuestion}&media=http://assets.tumblr.com/images/og/chat_200.png{/block:Answer}
{block:Answer}http://reddit.com/submit?url={URLEncodedPermalink}&title={block:Caption}{PlaintextCaption}{/block:Caption}{/block:Answer}
{block:Answer}http://reddit.com/submit?url={URLEncodedPermalink}&title={block:Caption}{PlaintextCaption}{/block:Caption}{/block:Answer}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.