У нас вы можете посмотреть бесплатно How to enqueue JavaScipt files conditionally in WordPress или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Enqueuing is the WordPress way to add a stylesheet or JavaScript file on a page. This video will show you how to enqueue a JavaScript file only on certain pages of your WordPress site. You may want to use this trick to achieve any of the following: • You want a JavaScript pop-up to only appear on your homepage (or on all pages BUT your homepage) • You only want a JS file or CSS ruleset on a certain page • You only want to load a script or style for certain pages You will need to know how to write an action hook, and which conditional tags to use, guides for which can be accessed here: https://wpshout.com/quick-guides/use-... Code from the video: ``` add_action('wp_enqueue_scripts', 'qg_enqueue'); function qg_enqueue() { if (is_home()) { wp_enqueue_script( 'qgjs', plugin_dir_url(__FILE__).'quick-guide.js' ); } } ``` If you found this video helpful, give it a like, and subscribe to WPShout for more videos! Have more questions? Leave us a comment below, and we’ll offer what wisdom we can. Get more quality WordPress tutorials in your inbox every Tuesday: https://wpshout.com/newsletter/ WPShout: In-Depth WordPress tutorials for Developers.