最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

customization - Add a custom intro page

programmeradmin2浏览0评论

I made an animation for an intro page with HTML, CSS,javascript and some images, it's all in one file, what do I need to do to, to display it first and then go to the regular template.

I've already found this topic that say how to redirect

Creating intro page in wordpress

My question is more oriented to the folowing doubts:

  • I need to add some PHP, to the existing code(the one I created)?
  • Where do I put the file? wp-content/themes/MySelectedTheme?
  • Where do I put the the images?
  • Do I need to modify something in the dashboard?

Thanks!

I made an animation for an intro page with HTML, CSS,javascript and some images, it's all in one file, what do I need to do to, to display it first and then go to the regular template.

I've already found this topic that say how to redirect

Creating intro page in wordpress

My question is more oriented to the folowing doubts:

  • I need to add some PHP, to the existing code(the one I created)?
  • Where do I put the file? wp-content/themes/MySelectedTheme?
  • Where do I put the the images?
  • Do I need to modify something in the dashboard?

Thanks!

Share Improve this question edited Apr 29, 2019 at 10:03 Mefistofeles asked Apr 29, 2019 at 9:32 Mefistofeles Mefistofeles 51 silver badge5 bronze badges 1
  • 1 what do you mean I need to add some PHP, to the existing code to where? – Vishwa Commented Apr 29, 2019 at 9:58
Add a comment  | 

1 Answer 1

Reset to default 0

Yes, you should put everything in the theme you're using. A lot depends on it's file organization. Basically you can put it anywhere in theme's scope, but it's good practice to maintain order in themes files, like have specific folder for images, scripts, views and other file types. Usually this structure is recognizable in the theme itself, so I advice you to hold to the structure.

But as I don't know your theme - for sake of this question lets create a folder called intro where you put all files related to intro. Then you might want to redirect to it from functions.php level. In very beginning of functions.php file I'd paste following code:

if (!isset($_COOKIE['visited'])) /* if the visitor is a new */
{
    setcookie('visited', true, time() + 3600 * 24);
    include( 'intro/index.html');
    exit();
}

Where index.html or index.php would be file with animation you've created.

I must mention, though, that redirections and animations on the main page are bad practice from UX and SEO point of view as it will make waiting period for main content even longer. If an animation is truly needed then I'd rather try to fix it throught javascript, for example a div which would dissapear after few seconds instead of making redirection.

发布评论

评论列表(0)

  1. 暂无评论