I figured out the reason.
Loading of styles and scripts occurs if the content ($post->post_content) contains a shortcode ([salon/] etc.).
But if the shortcode is inserted directly into the .php post/page template as
echo do_shortcode('[salon/]');
then, accordingly, styles and scripts are not loaded.
Hope developers fix this issue in the future, @wordpresschef.
——————————————————-
As a temporary solution, I suggest disabling shortcode verification in the content, but then styles and scripts are loaded on every page of the site.
/salon-booking-system/src/SLN/Action/InitScripts.php
line #24
public function hook_enqueue_scripts() {
global $post;
if (!$this->isAdmin && is_a( $post, 'WP_Post' ) /* && (
has_shortcode( $post->post_content, SLN_Shortcode_Salon::NAME ) ||
has_shortcode( $post->post_content, SLN_Shortcode_SalonMyAccount::NAME ) ||
has_shortcode( $post->post_content, SLN_Shortcode_SalonCalendar::NAME ) ||
has_shortcode( $post->post_content, SLN_Shortcode_SalonAssistant::NAME ) ||
has_shortcode( $post->post_content, SLN_Shortcode_SalonServices::NAME )
)*/
)
{
self::preloadScripts();
self::enqueueTwitterBootstrap(false);
$this->preloadFrontendScripts();
}
}
——-
Temporary fix screenshot
-
This reply was modified 3 years, 5 months ago by Yurets.