Title: Possible bug with elementor/frontend/before_enqueue_scripts
Last modified: January 31, 2017

---

# Possible bug with elementor/frontend/before_enqueue_scripts

 *  [Michael Garcia](https://wordpress.org/support/users/progressionstudios/)
 * (@progressionstudios)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/possible-bug-with-elementorfrontendbefore_enqueue_scripts/)
 * I’m adding some additional widgets to the page builder and want to include custom
   javascript. I found the API for enqueueing javascript however ran into issues:
   [https://github.com/pojome/elementor/blob/develop/docs/content/hooks/php-hooks.md#frontend-actions](https://github.com/pojome/elementor/blob/develop/docs/content/hooks/php-hooks.md#frontend-actions)
 * The code works great when I view the page on the front-end, however when I open
   up the Elementor editor the javascript doesn’t load. Let me know if this is a
   bug OR if I should be enqueuing using a different function.
 * Even better, is there code to enqueue JS per widget/element? I tried using wp_enqueue_script
   within the protected function render() {} which worked on the front-end but again
   didn’t work when viewing using the elementor editor.
    -  This topic was modified 9 years, 3 months ago by [Michael Garcia](https://wordpress.org/support/users/progressionstudios/).

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [Michael Garcia](https://wordpress.org/support/users/progressionstudios/)
 * (@progressionstudios)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/possible-bug-with-elementorfrontendbefore_enqueue_scripts/#post-8988784)
 * Additional Information on issue:
 * I’m having trouble enqueuing scripts and styles. I setup a simple CSS file that
   forces the background red for testing. This works when viewing the frontend; 
   however when I view the backend the style-sheet does not get loaded. What is 
   the proper way to enqueue script/styles?
 * Screen-shot Front-end showing style-sheet applied: [http://i.imgur.com/QaN9UGO.png](http://i.imgur.com/QaN9UGO.png)
   
   Screen-shot showing missing style-sheet when editor open (No Red Background):
   [http://i.imgur.com/gYk2xQY.png](http://i.imgur.com/gYk2xQY.png)
 * Code being used:
 *     ```
       add_action( 'elementor/frontend/before_enqueue_scripts', function() {
       	wp_enqueue_style( 'example-frontend-styles' );
       } );
       ```
   
 * Second Question: Is there code to enqueue CSS/JS per widget/element? I tried 
   using wp_enqueue_style within the protected function render() {} which worked
   on the front-end but again didn’t work when viewing using the elementor editor.
   Same issue as above.
    -  This reply was modified 9 years, 1 month ago by [Michael Garcia](https://wordpress.org/support/users/progressionstudios/).
 *  Plugin Author [ArielK](https://wordpress.org/support/users/arielk-1/)
 * (@arielk-1)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/possible-bug-with-elementorfrontendbefore_enqueue_scripts/#post-8989795)
 * Thanks for your comment, we’ll consider it for the next versions.
 * Note: This is the kind of issue that you can write in our project at GitHub.
   
   [https://github.com/pojome/elementor/issues](https://github.com/pojome/elementor/issues)
    -  This reply was modified 9 years, 1 month ago by [ArielK](https://wordpress.org/support/users/arielk-1/).
 *  Plugin Author [Yakir Sitbon](https://wordpress.org/support/users/kingyes/)
 * (@kingyes)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/possible-bug-with-elementorfrontendbefore_enqueue_scripts/#post-8990417)
 * Please see this example how to use custom JS code in widgets: [https://github.com/pojome/elementor-hello-world/commit/9e11c31c67440fa3be7e3a35df196d7b049a74cd](https://github.com/pojome/elementor-hello-world/commit/9e11c31c67440fa3be7e3a35df196d7b049a74cd)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Possible bug with elementor/frontend/before_enqueue_scripts’ is closed
to new replies.

 * ![](https://ps.w.org/elementor/assets/icon-256x256.gif?rev=3444228)
 * [Elementor Website Builder - more than just a page builder](https://wordpress.org/plugins/elementor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/elementor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/elementor/)
 * [Active Topics](https://wordpress.org/support/plugin/elementor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/elementor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/elementor/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Yakir Sitbon](https://wordpress.org/support/users/kingyes/)
 * Last activity: [9 years, 1 month ago](https://wordpress.org/support/topic/possible-bug-with-elementorfrontendbefore_enqueue_scripts/#post-8990417)
 * Status: not resolved