Making Tumblr Landing Page

*爱你&永不变心* 提交于 2019-12-05 06:45:56

问题


On Tumblr, I am trying to make a landing page with, for example, an "Enter" button that brings the user to the home page. I found the following code that redirects the site to a /welcome page, which I placed in the index page.

<script type="text/javascript">
if(location.href == 'http://ihadcats.tumblr.com/') location.replace('http://ihadcats.tumblr.com/welcome');;
</script>

Of course, on the 'welcome' page, when you press <a href="http://ihadcats.tumblr.com" it just loops back to the welcome page.

I created a custom page '/home', to use instead of the index page. I placed the normal index code into a separate '/home' page, but the code doesn't render. It displays, for example "{Title}" instead of the actual title.

When the Index page is loaded, Tumblr bakes in a lot of its own scripts. When the '/home' page is loaded, none of Tumblr's scripts are loaded. Though the code in both pages is exactly the same. Any ideas?


回答1:


Tumblr variables and blocks don't render on custom pages, only in the main theme code. Basically it doesn't see them as special key words or anything it just sees them as a normal webpage would see them.

As for making a landing page you can tag every post you make with some arbitrary tag like 'x' and then make your index page a landing page and then wrap all your code in {block:TagPage} {/block:TagPage} so that the theme code only displays on tag pages (and you would code permalink pages like normal).

Alternatively you could do as suggested above and make a welcome 'popup' of sorts.



来源:https://stackoverflow.com/questions/29222013/making-tumblr-landing-page

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