Closed aidanayala closed 7 years ago
You can do the following and use the filter to load the js or css for the specific page that you use your shortcode
$enqueue->front([
'as' => 'postsJS',
'src' => Helper::assetUrl('/js/post.js')
'filter' => [ 'panel' => ['mainPanel', 'subPanel'] ]
]);
for more reference
Thank you
I display my frontend UI when a shortcode is placed within a page.
How can I use enqueue to load the necessary js/css when this view / shortcode is used?