Reputation: 133
I just installed wordpress through docker-compose. Before installation I have 2 files product.html and order.html and a script.js file that is used in these 2 html files.
Now that I have created my site with wordpress, I would like to know how I can add these 2 html files in wordpress and cleanly load my script.js in these files ?
When I looked, I saw that it is necessary to load the script.js by using "wp_enqueue_script" in a "function.php" but what I do not understand where is this "function.php" or I have to create it myself? And if I have to create it myself in which directory I must to place it ?
Thank you in advance !!!
Upvotes: 0
Views: 1148
Reputation: 287
You need to create a new directory theme-name
under:
wp-content/themes/theme-name
and put the style.css
and functions.php file with some basic comments
Take a look on Wordpress Theme Development page to start from scratch.
You can also dig the default Wordpress themes under wp-content/themes
directory.
Upvotes: 0
Reputation: 109
The functions.php is located in the theme directory. You can either create a child theme or create your own custom theme to change the functions.php. If you change the functions.php of an existing theme (like Twenty Nineteen) your changes will be overwritten by the next theme update.
WordPress has extended documentation on how to create your own theme from scratch. Note that this takes up a lot of time but allows the most customization of your site.
Upvotes: 0
Reputation: 515
Try to do this.
<script src="http://www.yoursite.any/wp-content/themes/your-theme/js/file.js"></script>
Add this into your footer.
Carate one new template and added your HTML. Try this for creating the template. https://www.cloudways.com/blog/creating-custom-page-template-in-wordpress/
Upvotes: 1