Skip to content

Instantly share code, notes, and snippets.

@alaiacano
Created October 22, 2012 21:19
Show Gist options
  • Save alaiacano/3934462 to your computer and use it in GitHub Desktop.
Save alaiacano/3934462 to your computer and use it in GitHub Desktop.
optionally display source attribution in a tumblr theme
{block:Posts}
<script language="JavaScript">
var source_url = '{block:ContentSource}{SourceURL}{/block:ContentSource}';
var reblogged_from = '{block:RebloggedFrom}{ReblogParentName}{/block:RebloggedFrom}' + '.tumblr.com';
if (source_url.indexOf(reblogged_from) == -1) {
document.write('Your attribution string!');
}
</script>
{/block:Posts}
@alaiacano
Copy link
Author

this probably won't work for blogs with custom domains like davidslog.com, so you're on your own there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment