Home › Forums › Back End › WP – How to add a script to a specific page › Reply To: WP – How to add a script to a specific page
September 8, 2014 at 8:03 am
#182138
Participant
I just found out thatis_page_template
only works if it’s an actual PAGE — it won’t work on POSTS.
Instead, the check should be done on something like this:
if( 'mycustomtypename' == $post_type ) {
wp_enqueue_script( 'googleapi' );
wp_enqueue_script( 'googlemaps' );
}
This guy is doing it (even with the if statement) and it works. Hmm.
I don’t think he actually said it works with that conditional statement…. I may be wrong. @taxicss can you elaborate please?