popup window without Wordpress plugin

1

I created a popup window with html, css and js all in a .html file, I want to incorporate that popup in the "home page" that I'm designing in Wordpress with Avada Theme and that you see nothing else when loading the page. I've already tried with multiple plugins and they do not work. In which folder of wordpress or Avada theme do I place this html file (popup) and where do I call the function to appear on the home page?

function popup(mylink, windowname) { 
    if (! window.focus)return true; 

    var href; 
    if (typeof(mylink) == 'string') href=mylink; 
    else href=mylink.href; 

    window.open(href, windowname, 'width=400,height=200,scrollbars=yes'); 
    return false;
} 

<BODY onLoad="popup('autopopup.html', 'ad')">
    
asked by Meyado 26.04.2016 в 20:57
source

1 answer

1

You can do the following process:

1) Implement the JS in a file inside the js folder of the theme, it is usually in the following path / wp-content / themes / avada / js / there you can create a file for example scripts.js

2) In the functions.php file of the same theme you can register the JS - > link

3) To insert this line in the Body you should look for the header.php file of the template and edit the line to enter the onload call:

 <BODY onLoad="popup('autopopup.html', 'ad')">

With this process you could have the code mounted on WP.

    
answered by 28.04.2016 / 08:16
source