I made a separate html file with custom css and js files. I want to integrate it into a wordpress site. I can copy and paste the body part of the html, however I don't know how to add css and js files properly. If I modify header.php, it will add these files to all pages and I don't want that. What is the solution?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
When you will add the page from the
WordPress
back end, usingPages->Add new
from the menu, you have to give a title and using that title (also possible using slug and id) you can checkis_page('page title here')
and then can addJavaScript
andcss
files, likepaste this code in your
functions.php
and check wp_enqueue_style and wp_enqueue_script for better understanding of these functions and usage, also is_page and wp_enqueue_scripts if needed.