Search code examples
javascriptjqueryhtmltumblrunwrap

Remove specific HTML with jQuery on Tumblr Theme?


I'm trying to mimic the new Tumblr Text Post that removes blockquotes so all the important text is visible in a 250px text post without having to scroll. Of course Tumblr hasn't updated their entire code so blockquotes are still wrapped in custom themes.

Here's what I have so far: http://01244235.tumblr.com/

I unwrapped the blockquote tag. Now I want to remove the links of the users who have commented.

I know there isn't a simple way of just unwrapping the entire thing until Tumblr updates their codebase. So I'm just going to remove the links entirely.

So is there a way to pick up a specific part of the code and remove it? I don't want to just remove href links because the actual text post might have some in it.

So I want to remove every <p><a class="tumblr_blog" href=""></a></p> from the post.

Any ideas?


Solution

  • In that case you would write:

    $('p .tumblr_blog').remove();
    

    But why not just remove the {Blockquote} tags from the theme, rather than relying on a front end solution. Or even just hide it using css:

    p .tumblr_blog {
       display:none;
    }