Search code examples
javascripthtmltumblr

Dynamically updating "Avatar" in tumblr


On my tumblr page, I want to have an avatar appear next to the blog post for whoever wrote the post. The only way I can think of doing this is having the person add their name in the title of the blog.

Title - Name

Then I would parse it and use the name to grab the right avatar.

This works only for the latest blog. (NOTE: This is just a test function!)

    function Tom(t)
    {
        if(t)
        {  
            return "JMY";

        }

        return "JIMMY";
    }

Is there a better way to do this? If not, how do I get the script to run for each blog post, not just the latest one.


Solution

  • Post Authors

    Tumblr allows multiple authors to post content to a single 'blog'. You can include their information in your theme HTML, using the following template tags:

    {PostAuthorName} = Name of the post Author.
    {PostAuthorPortraitURL-48} = Avatar of the post Author.

    Overview of all tags related to Post Authors here: http://www.tumblr.com/docs/en/custom_themes#post-authors