Enqueue plugin in functions.plp
-
Hello,
I need to queue plugin execution via functions.php. How to use wp_enqueue_script method properly?
-
Hi @dskrzysiek,
Greetings from CookieYes!I need to queue plugin execution via functions.php. How to use wp_enqueue_script method properly?
We understand that you were looking for a solution to a specific problem, but the above quote will not be possible.
If you could provide more details about your requirement, our team will be happy to check if there is any alternative solution that we can offer.
Looking forward to hearing back from you.
I want to delay the loading of the script to achieve a higher score on Google Speed Insights. I stopped the plugin from loading using the wp_dequeue_script method but I can’t get it to start again on the page. I want to do everything in functions.php
Hi @dskrzysiek,
Thanks for providing more information regarding your requirement. If you perform anything as described by you, the chances are the plugin will not function as intended.
Our priority is to make sure that the plugin can effectively assist you in achieving compliance on your site, and if it cannot, it would not serve its purpose. However, we are here to help and provide support if you have any additional questions or concerns.
Hi @dskrzysiek,
As this thread has been inactive for some time, we will mark it as resolved. However, please do not hesitate to open a new thread or follow up with us if you have any additional questions or require further assistance. We are always happy to help. Thank you for your understanding.Anyway, I would like to deactivate the plugin via functions.php and then activate it with the next function. I managed to deactivate it:
wp_dequeue_script(‘cookie-law-info’);
but activea doesn’t work anymore, i tried this:
$urlCookie = ‘https://’ . $_SERVER[‘SERVER_NAME’] . ‘/wp-content/plugins/cookie-law-info/legacy/public/js/cookie-law-info-public.js’;
wp_enqueue_script( ‘cookie-law-info’, $urlCookie, array(), ‘1.1.1’, true );I will be grateful for your help 😀
-
This reply was modified 2 years, 12 months ago by
dskrzysiek.
-
This reply was modified 2 years, 12 months ago by
dskrzysiek.
Hi @dskrzysiek,
While it may not be possible to fulfil your initial request, we would be more than happy to assist you if you could provide us with additional information about your specific situation and explain the intended use case. This would enable us to better understand your needs and offer more tailored and effective solutions. Please feel free to share any relevant details with us.
Hi @dskrzysiek,
As this thread has been inactive for a while, we are marking it as resolved. We suggest to open a new thread in the forum if you need any further assistance. -
This reply was modified 2 years, 12 months ago by
The topic ‘Enqueue plugin in functions.plp’ is closed to new replies.