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!

  • 1
    what do you mean I need to add some PHP, to the existing code to where? – Vishwa Apr 29 at 9:58
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.