How to remove the “Source:” from this Tumblr theme?

让人想犯罪 __ 提交于 2019-12-23 02:07:10

问题


I am trying to edit the Tumblr theme below so as to remove the "Source:" portion that appears at the bottom of every post I reblog.

I don't mind giving credit where credit is due, but this information is already visible in the Tumblr app and on the permalinks of each post... I just want it to not clutter the homepage.

Here's an example of how a reblog currently looks.

And here's the code of the theme I'm currently using.

I've tried editing the code to make the "Source" line disappear, but to no avail. Can anyone tell me what I'm missing?


回答1:


It looks like this is being added from a javascript include, perhaps. I don't see anything in the source code on your Example blog or in the template that would include that. Try the solution found here:

Some themes do not include the source link codes which makes “via/source” links automatically appear under posts (such as quotes or text). To remove those, insert the following between {block:posts} and {/block:posts}

{block:ContentSource}
<!-- {SourceURL}{block:SourceLogo}<img src="{BlackLogoURL}"
width="{LogoWidth}" height="{LogoHeight}" alt="{SourceTitle}" />  
{/block:SourceLogo}
{block:NoSourceLogo}{SourceLink}{/block:NoSourceLogo} -->
{/block:ContentSource}

What you’re doing is hiding the codes so that it ONLY appears in the CODES (are not displayed unless you search up HTML) since you’re adding around the codes which makes it a “comment”. It’s still read, but it’s hidden and only visible in the source code.




回答2:


To get rid of the "source" and also the "via" paste this code below the "{/block:posts}"

{block:ContentSource}
<!-- {SourceURL}{block:SourceLogo}<img src="{BlackLogoURL}"
width="{LogoWidth}" height="{LogoHeight}" alt="{SourceTitle}" />
{/block:SourceLogo}
{block:NoSourceLogo}{SourceLink}{/block:NoSourceLogo} -->
{/block:ContentSource}

<!--{block:NoRebloggedFrom}{block:RebloggedFrom}{ReblogParentName}{/block:RebloggedFrom}{/block:NoRebloggedFrom} --> 



回答3:


You can remove those paragraphs generated by Tumblr using jQuery's .remove() function.

http://api.jquery.com/remove/

$("p").remove(":contains('Source:'),:contains('via ')");


来源:https://stackoverflow.com/questions/24643215/how-to-remove-the-source-from-this-tumblr-theme

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!