Javascript on Individual Tumblr Post

前端 未结 1 901
醉话见心
醉话见心 2020-12-19 18:18

I am aware that you can edit the html/AngularJS that renders the all posts blog homepage on a tumblr blog. But, is there any way to add a custom

1条回答
  •  星月不相逢
    2020-12-19 19:07

    When writing a post, on the menu bar where you can click bold, italic, strikethrough, etc, there is a button that says . If you click this, it will bring up the HTML for the post. Then, all you do is have to add a script tag with the javascript code you want. For example:

    
    

    NOTE: I believe the javascript will only work when users navigate to your actual page, not when it is in their feed unless the box that is shown to represent extra content is clicked. This is to prevent unnecessary content from showing and keeping load time low in the feed

    EDIT: If you want the same javascript to apply to all posts you write, I'd put it into the theme's HTML. To do so you'd go to Customize -> Edit HTML (of the theme) -> put

提交回复
热议问题