I wondered if someone could help me with editing the wpshopify/wp-shopify.php in WordPress.
My goal is to make the Shopify plugin work on certain pages and not run on other pages.
So for example I would like the plugin to work on the [shop]
page and not the [about us]
page.
I have seen some "Plugin Organizers" but unfortunately I couldn’t make it work.
Does anyone have the experience or know-how to get this done?
2
Answers
If you want to manage the styles and JavaScript of a plugin in WordPress so that on any page you just want to be loaded and used, I suggest using the following plugins.
But if you want to write a condition that you can manage, it means a specific plugin only when you want it to work like a specific page. For this you need to know the exact name of the plugin and then do it using a plugin management function.
I wrote this code and tested it, it worked properly.
In this code, I first check the post ID, whether page or post or any other type of post.
Then I disable all plugin styles and scripts and delete the class that is attached to the body
Finally, I remove a new element created in a class to display the plugin root.
Put this code in the
functions.php
file