Home › Forums › General Issues › Folder for Javascript › Reply To: Folder for Javascript
I’m still confused. In this page at WordPress, I see an example that looks like a path:
<script type="text/javascript" src="/scripts/emailpage.js"></script>
Are you saying that I register my script with a certain name, then put that name in the script below where it says ‘my-admin-js’?
function my_admin_enqueue_scripts() {
wp_enqueue_script( 'my-admin-js', get_template_directory_uri() . '/js/example.js', array(), '1.0.0', true );
}
add_action('admin_enqueue_scripts', 'my_admin_enqueue_scripts');
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.