Title: Adding single listing scripts/styles to custom template
Last modified: August 22, 2016

---

# Adding single listing scripts/styles to custom template

 *  Resolved [jasonday](https://wordpress.org/support/users/jasonday/)
 * (@jasonday)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/adding-single-listing-scriptsstyles-to-custom-template/)
 * I’m using a custom template for the single-listing.php.
 * I’ve used my own theme (Canvas by woothemes) single post template, and included
   the wp-listings code. [http://pastebin.com/cAYFEruA](http://pastebin.com/cAYFEruA)
 * The issue I’m having is that my custom single-listing.php is in my child theme
   directory. Because of this the following code doesn’t work because the file paths
   are different:
 *     ```
       add_action('wp_enqueue_scripts', 'enqueue_single_listing_scripts');
       function enqueue_single_listing_scripts() {
       	wp_enqueue_style( 'wp-listings-single' );
       	wp_enqueue_style( 'font-awesome' );
       	wp_enqueue_script( 'jquery-validate', array('jquery'), true, true );
       	wp_enqueue_script( 'fitvids', array('jquery'), true, true );
       	wp_enqueue_script( 'wp-listings-single', array('jquery, jquery-ui-tabs', 'jquery-validate'), true, true );
       }
       ```
   
 * None of these are loading in my custom template.
 * What’s the best way to include them correctly?
 * [https://wordpress.org/plugins/wp-listings/](https://wordpress.org/plugins/wp-listings/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [agentevolution](https://wordpress.org/support/users/agentevolution/)
 * (@agentevolution)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/adding-single-listing-scriptsstyles-to-custom-template/#post-5564777)
 * The scripts are registered by the plugin (in plugin.php) with the file path defined
   to the scripts in the plugin, so having your template in a child theme should
   make no difference. That function is just enqueuing those registered scripts.
 *     ```
       /** Registers and enqueues scripts for single listings */
       	add_action('wp_enqueue_scripts', 'add_wp_listings_scripts');
       	function add_wp_listings_scripts() {
       		wp_register_script( 'wp-listings-single', WP_LISTINGS_URL . 'includes/js/single-listing.js' ); // enqueued only on single listings
       		wp_register_script( 'jquery-validate', WP_LISTINGS_URL . 'includes/js/jquery.validate.min.js' ); // enqueued only on single listings
       		wp_register_script( 'fitvids', '//cdnjs.cloudflare.com/ajax/libs/fitvids/1.1.0/jquery.fitvids.js', array('jquery'), true, true ); // enqueued only on single listings
       		wp_enqueue_script( 'jquery' );
       		wp_enqueue_script( 'jquery-ui-tabs', array('jquery') );
           }
       ```
   
 * You could try giving them the same path as the wp_register_script in the enqueue
   function.

Viewing 1 replies (of 1 total)

The topic ‘Adding single listing scripts/styles to custom template’ is closed to
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-listings_978e8f.svg)
 * [IMPress Listings](https://wordpress.org/plugins/wp-listings/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-listings/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-listings/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-listings/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-listings/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-listings/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [agentevolution](https://wordpress.org/support/users/agentevolution/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/adding-single-listing-scriptsstyles-to-custom-template/#post-5564777)
 * Status: resolved