

So using Advanced > Custom CSS field is a good place. What about all my articles on this website? Why don't they recommend using this plugin to insert Javascript and CSS?įor CSS, it is most often better to place it only on the page where it is needed. The examples given below should get you started though. The main disadvantage is that it is somewhat less beginner friendly, and you need to learn at least a little bit of PHP to fully take advantage of the plugin.

You write every snippet in PHP, giving much greater flexibility.HTML is also accepted, allowing for the creation of shortcodes, preloaders, popups, etc.You can filter the snippets to apply by pages, posts, categories, tags, etc.You can separate different snippets, and activate and deactivate them individually, when needed.You can place the Javascript exactly where you want (head, body, footer).So, why is writing Javascript in a Code Snippet is better than, say, Easy CSS & Javascript plugin? In WordPress and Elementor tutorials, it is not uncommon for you to be asked to add custom code snippets, frequently directly in your theme’s functions.php file.īut how do you carefully go about it when even the slightest error can break your site?Īnd how do you easily manage multiple code snippets that you added left and right? Why using Code Snippets is better
