Oct 13

How to Include Reddit in Tumblr

I wanted to include a reddit widget in my posts, in order to submit and vote on entries. Here’s a theme snippet that solves the task:

<script type="text/javascript">
    reddit_url = "{Permalink}";
</script>
<script type="text/javascript" src="http://www.reddit.com/button.js"></script>

Put in a simplified tumblr theme:

{block:Posts}
    {block:Text}
        <div class="post text">
            {block:Title}
                <h3><a href="{Permalink}">{Title}</a></h3>
            {/block:Title}
            {Body}
            <script type="text/javascript">
                reddit_url = "{Permalink}";
            </script>
            <script type="text/javascript" src="http://www.reddit.com/button.js"></script>
        </div>
    {/block:Text}
{/block:Posts}

More info on how to customize the reddit widget can be found here.



Simon Pantzare
Simon Pantzare, also available on
Facebook,
Twitter,
Google+,
Reddit,
Github (dev blog).
Ask me anything.