I suspect that WP host evironment can process functions.php or custom .php template much faster than using code snippet plugin. The same is true about CSS perfomance. It also worth note that using child theme is much safer than do custom .php or .js functioning hooked via plugin.
Nice plugin but more often than not while developing there are chances Wordpress crashes or it simply doesnt open because of some bug or plugin conflict and we might have to simply recreate the site. So, isnt it better to have child theme so that I can go to File Manager and take the copy of child theme and that way I have all the changes I made in css or javascript in child theme. Same is the case when I delete the plugin and all the changes are deleted and then I decide that I need the changes but now I dont have it. In child theme, I would simply comment it. So, I find having snippets in the plugin a little cumbersome.
Thank you Paul for the very valuable video as usual. I'm using Code Snippet but as you mentioned, at first it was so confusing to me too. Also, I would like to see the option of choosing to run the snippet in certain pages (and or to be able to exclude it from certain pages - an Elementor like logic) It would be very useful for example, in case of using a chat JS code.
I always use this plugin but I also almost always work on a child theme in case I want to make any changes to the template files of plugins and themes.
" :D " LOL nice intro... I will follow this, i used code snippets from codepen, but always had a hard time with all others plugins, so im not sure about that :D sure, if u make a outsourced design? The whole site and features?
Thank you for this unexpected video! Well done, you should drink and record more often :-) Also.. 3:40: we'll make that happen, thanks for the feedback! 16:35 our upcoming easy entry pro version will handle that.. and so much more! More to come soon!
I would not change a single thing about the plugin. And I'm a WP beginner. What the user actually needs, is a database of examples, a tutorial on how to find hooks and how to run the snippet on specific pages. Ok, maybe just hook the JS example to the footer...
I would love if you made a video that combined "code snippets" with "unlimited elements for Elementor". I haven't tried this yet, so I don't know if it is possible. The idea is simple: 1 - Have some code-snippet that also takes parameters. For example, take the code that you had in the "how to get error messages on a login page". But add to it "parameters" (such as "Error Message", "Font and so forth", "Background Color of Error Message", etc. Then convert it into an Elementor Widget using the free version of Unlimited Elements for Elementor. Now, all of a sudden, I can "drop in" the error message in case of the failed login, and stylize it using full Elementor capabilities. Since I have not tried it yet, I am not sure whether we would need both "Code Snippets" as well as "Unlimited Elements", but I suspect we do. The first code snippet you used in that video would be installed via the code-snippets plugin. I'm not sure if "code snippets" allows for parameterized snippet code. Then the actual definition of the shortcode would have parameters for the above mentioned items (text, styling, etc).. Then this would all be wrapped up into an Elementor Widget using Unlimited Elements for Elementor (free version). That would be both cool, as well as a generally instructive technique. Assuming that all the pieces would line up with each other .. What do you think? p.s. I will cross-post this also on the other TH-cam you did in the last few days.
That’s great, thanks. Hadn’t realised about the wrappers for css etc. Probably explains why I struggle with it! Another idea might be for a library of snippets to draw from if you run multiple sites. Bit like Elementors templates maybe.
The one thing that really doesn't do it for me (and please correct me if I am wrong) is how you use conditional login like only displaying on a custom post type post or a page that has a certain title. I looked and I must be blind. Additionally, if I have images in my theme that I do not want to upload to the media library just in case it gets deleted by the client, how is that done wit ha tool like this?
Very interesting. I have a child theme that has accumulated over the years, and elements of the style.css and functions.php files are certainly unnecessary. Is it worth trying to reform as Code Snippets, piece by piece? And what about WooCommerce variations that are critical to the site? Do these still necessitate sticking with a Child Theme? Many thanks
I'd honestly say that it it ain't broke, don't fix it. Sure, you could move things over to something like Code Snippets, but that's an extra plugin to maintain and update regularly to effectively achieve the same thing you have now. If it was a new build or a revamp of the existing site, then I'd look at it differently, but for now, I'd say to stick with what you have working. :)
Many thanks for the wise advise. I suppose I was afraid of leaving until later a problem than I should start to tackle now. But, as you say, if it ain’t broke... As Allen Ginsberg wrote, It’s never too late to do nothing at all. :) Thanks for the great work. Subscribed
Hello Paul, I'm going to try this plugin today. I am trying to display the ACF product fields on the front end , to give vendors the option to select from the new fields when adding a new product. I will try it out and let you know how it goes. I am just beginning to learn about coding, I would love an ACF + Code Snippet tutorial. how to display custom fields on front end but as i said i will try it out this afternoon and check back in :)
Big no no. Tried that on one site. The second you write one character wrong, the site is dead. You have to go in to MySQL and in to the database, find the snippet you just made and delete it from the database to get the site back alive. If the same happen in functions.php. You edit it in 5s, upload the file again and your live.
Actually, you can very easily fix any coding errors you made simply by: 1. nl.wordpress.org/plugins/code-snippets/#%0Ahow%20can%20i%20recover%20my%20site%20if%20it%20is%20crashed%20by%20a%20buggy%20snippet%3F%20(method%20one)%0A or 2. nl.wordpress.org/plugins/code-snippets/#%0Ahow%20can%20i%20recover%20my%20site%20if%20it%20is%20crashed%20by%20a%20buggy%20snippet%3F%20(method%20two)%0A
Gail Forder yeah but sometimes as little as a dot in the wrong place can be wrong. And I would like to fix it in 5s instead of 5 minutes. And changing themes, copy the code from the functions.php to the new themes child functions.php will take what? 10s? I just think this plugin is 100% unnecessary. Creates more problems than solving them. Cheers.
Verdi Heinz yeah. Just go in to you wp-config file etc etc. THEN YOU ARE ALREADY IN THE SAME PLACE AS YOUR FUNCTIONS.PHP FILE!!? This just adds more work then necessary.
I have a plugin where I've edited a JS file but I'm worried it will be overwritten if and when there is an update for that particular plugin. How do I go about using code snippets to insert my custom code (just a few lines) at the right place in that Javascript file using code snippets?
One of the themes (a while ago anyway) used to use "hooks" in a similar fashion. They would have a text area for stuff that was to go into the header, one for the footer and so on. They seemed to include those PHP functions outwith the text area. In their instance, that google An. code you pasted in would have been fine. So I'm with you on that - for noobs especially, have the functions pre-written/included and hidden. :)
Yes! A few themes / plugins did this. For example, TotalPress theme has hooks, and GeneratePress pro did this via a plugin somehow. The issue was that the hooks were really up to the theme author as to where they happened on the page / site - otherwise you're back to hacking at child themes and functions. 😱
Great video as usual, although I don't think that plugin can add snippets on a per page basis such as adding google analytics tracking code to the thank you page etc, but love your tutorials, keep them coming..
Hi wptuts, I am stuck for so long on this one, hope you have something that can help in this situation. 1. Created a front end form and acf repeater section for a table ( something like a pricing table) 2. Linked this to elementor section 3. Everything works as long as there is content in acf field. 4. If someone chose to not edit this table then the entire section need to be hidden as it will show some redundant headings and other stuff , I couldn't find a way to hide the entire section of acf field is empty?
Excellently done and very useful to know - Thank you! (and perfect for us retired IT folks who are happy enough using plugins -and code only when needed).
@@christiandominiclangreo5101 You somehow say the same thing as me though. You need to be "really into Wordpress" . Like deeper level. If you really need those extra custom style that pre-set with the planed idea . Then Yeah, Why not ?
Ah do Developers, please don't listen. Please Please don't make the "Complete Uninstall" checked as default. I believe he forgot how many times he had to disable all plugins to debug a site. If checked by default, you are good to reconfigure the plugin. I really don't want this activated by default.
Thanks for providing this. The Code doesn't get rid of OceanWp messages. I will be so happy if this gets rid of wpforms messages also ill have to report back on that. I hate wpforms with a passion bc of their stupid messages.
why the hell would you want to put a ccs change in a function. You are adding to the stress on the sql calls and execution. Pretty much the same for everything through this plugin. It has to execute its own code in order to execute the user code. How the hell is this better for functionality and speed. If you can code you should just edit the file ( child ), wont slow the site anywhere near as much
Yep - as he mentions around 16:24 ... What could be a nice idea is if this plugin allowed a way to inject a TYPE of snippet (via shortcode?) to the proper location, page etc. This way for example, CSS gets dropped in to CSS, per page JS only runs... per page :) etc. Imagine saving a snippet, then being able to use that snippet's shortcode on a specific page.
An upcoming Pro version will let you add CSS snippets to style.css instead of functions.php. And that not all we're doing to make your site faster and use (much) fewer plugins.
@@WPTuts Your title is Are child themes dead and your comment is yes so you are saying it is a good idea. Its still twice as much code to do the same thing as a child edited functions.php. A review and demo is fine but to infer its a better way is irresponsible. If it was a plugin that allowed non coders to do the same thing then maybe in those cases it would be but you have to code snippets. People who do videos like this very rarely take into account the effects on performance etc, especially if the site it is being used on has high traffic and is already stretched and not optimized and hosted properly.
Thank you for such an amazing and honest introduction! Hope that you had a great time 😀
I suspect that WP host evironment can process functions.php or custom .php template much faster than using code snippet plugin. The same is true about CSS perfomance. It also worth note that using child theme is much safer than do custom .php or .js functioning hooked via plugin.
exactly! those all plugins like this are overengineering, created for non coders to copy/paste code from the web to make some mess
Very nice. Thanks. (p.s. what's that CSS scan tool you used to check the H1 there?) It looks super handy. Browser extension?
Nice plugin but more often than not while developing there are chances Wordpress crashes or it simply doesnt open because of some bug or plugin conflict and we might have to simply recreate the site. So, isnt it better to have child theme so that I can go to File Manager and take the copy of child theme and that way I have all the changes I made in css or javascript in child theme. Same is the case when I delete the plugin and all the changes are deleted and then I decide that I need the changes but now I dont have it. In child theme, I would simply comment it.
So, I find having snippets in the plugin a little cumbersome.
Thank you Paul for the very valuable video as usual. I'm using Code Snippet but as you mentioned, at first it was so confusing to me too. Also, I would like to see the option of choosing to run the snippet in certain pages (and or to be able to exclude it from certain pages - an Elementor like logic) It would be very useful for example, in case of using a chat JS code.
This tutorial was very clear and concise. Thank you. Obviously not enough drinking, get back to it.
I always use this plugin but I also almost always work on a child theme in case I want to make any changes to the template files of plugins and themes.
" :D " LOL nice intro... I will follow this, i used code snippets from codepen, but always had a hard time with all others plugins, so im not sure about that :D sure, if u make a outsourced design?
The whole site and features?
I would never opt for adding another plugin instead of using a child theme. Child theme works faster and it is the way recommended by wp team.
Thank you. Dont you have security concerns? Plugin stores snippets in database, right?
Thank you for this unexpected video! Well done, you should drink and record more often :-)
Also..
3:40: we'll make that happen, thanks for the feedback!
16:35 our upcoming easy entry pro version will handle that.. and so much more!
More to come soon!
3:40 hope not too many developers listen to this
3:40 Also disagree with default selection to delete. leave as is.
@@frankdittmar +1
I would not change a single thing about the plugin. And I'm a WP beginner.
What the user actually needs, is a database of examples, a tutorial on how to find hooks and how to run the snippet on specific pages.
Ok, maybe just hook the JS example to the footer...
I would love if you made a video that combined "code snippets" with "unlimited elements for Elementor".
I haven't tried this yet, so I don't know if it is possible.
The idea is simple:
1 - Have some code-snippet that also takes parameters. For example, take the code that you had in the "how to get error messages on a login page". But add to it "parameters" (such as "Error Message", "Font and so forth", "Background Color of Error Message", etc.
Then convert it into an Elementor Widget using the free version of Unlimited Elements for Elementor.
Now, all of a sudden, I can "drop in" the error message in case of the failed login, and stylize it using full Elementor capabilities.
Since I have not tried it yet, I am not sure whether we would need both "Code Snippets" as well as "Unlimited Elements", but I suspect we do.
The first code snippet you used in that video would be installed via the code-snippets plugin. I'm not sure if "code snippets" allows for parameterized snippet code.
Then the actual definition of the shortcode would have parameters for the above mentioned items (text, styling, etc).. Then this would all be wrapped up into an Elementor Widget using Unlimited Elements for Elementor (free version).
That would be both cool, as well as a generally instructive technique.
Assuming that all the pieces would line up with each other .. What do you think?
p.s. I will cross-post this also on the other TH-cam you did in the last few days.
That’s great, thanks. Hadn’t realised about the wrappers for css etc. Probably explains why I struggle with it! Another idea might be for a library of snippets to draw from if you run multiple sites. Bit like Elementors templates maybe.
It's on the roadmap ;-)
Does the Elementor Pro Custom Code replace the free Code Snippets plugin?
Thank you Paul. I can see many uses for this in place of a child theme.
Hot bubbly water + Cold bubbly beverage = Best Day Ever. Plus super informative Code Snippets! Thank you!
Also, if they added the choice to apply the snippets to custom areas, page/pages, post/posts, forms, etc.
The one thing that really doesn't do it for me (and please correct me if I am wrong) is how you use conditional login like only displaying on a custom post type post or a page that has a certain title. I looked and I must be blind.
Additionally, if I have images in my theme that I do not want to upload to the media library just in case it gets deleted by the client, how is that done wit ha tool like this?
Drinking didn't threw you off. Keep on the good work. Share, share, share.
You had me at "drinking pretty much all afternoon" LOL
🤣
Custom css & js already provides a template when you add a new code with an indication of where you need to fill in your code.
Hey I love your videos..Can I paste any code before body tag using this plugin?
Excellent! You did well considering.😄
Nope, he just to well :-)
Thats one hell of a lead in Paul. Love it! hahahha
Very interesting. I have a child theme that has accumulated over the years, and elements of the style.css and functions.php files are certainly unnecessary. Is it worth trying to reform as Code Snippets, piece by piece? And what about WooCommerce variations that are critical to the site? Do these still necessitate sticking with a Child Theme? Many thanks
I'd honestly say that it it ain't broke, don't fix it.
Sure, you could move things over to something like Code Snippets, but that's an extra plugin to maintain and update regularly to effectively achieve the same thing you have now.
If it was a new build or a revamp of the existing site, then I'd look at it differently, but for now, I'd say to stick with what you have working. :)
Many thanks for the wise advise. I suppose I was afraid of leaving until later a problem than I should start to tackle now. But, as you say, if it ain’t broke... As Allen Ginsberg wrote, It’s never too late to do nothing at all. :) Thanks for the great work. Subscribed
@@PoetryFilms no problem at all and welcome to the WPCrue :0)
Hello Paul,
I'm going to try this plugin today. I am trying to display the ACF product fields on the front end , to give vendors the option to select from the new fields when adding a new product. I will try it out and let you know how it goes. I am just beginning to learn about coding, I would love an ACF + Code Snippet tutorial. how to display custom fields on front end but as i said i will try it out this afternoon and check back in :)
What a great tool. Yes, it has a possible performance downside but I love that it's so easy to see all changes at a glance.
Big no no. Tried that on one site. The second you write one character wrong, the site is dead. You have to go in to MySQL and in to the database, find the snippet you just made and delete it from the database to get the site back alive. If the same happen in functions.php. You edit it in 5s, upload the file again and your live.
Actually, you can very easily fix any coding errors you made simply by:
1. nl.wordpress.org/plugins/code-snippets/#%0Ahow%20can%20i%20recover%20my%20site%20if%20it%20is%20crashed%20by%20a%20buggy%20snippet%3F%20(method%20one)%0A
or
2. nl.wordpress.org/plugins/code-snippets/#%0Ahow%20can%20i%20recover%20my%20site%20if%20it%20is%20crashed%20by%20a%20buggy%20snippet%3F%20(method%20two)%0A
Verdi Heinz this is good stuff, keep up the good work 👏👏👏
Christian Schneider yes... he warned about that in a previous video I think... but if you know code you would know if something is missing eh.
Gail Forder yeah but sometimes as little as a dot in the wrong place can be wrong. And I would like to fix it in 5s instead of 5 minutes. And changing themes, copy the code from the functions.php to the new themes child functions.php will take what? 10s? I just think this plugin is 100% unnecessary. Creates more problems than solving them. Cheers.
Verdi Heinz yeah. Just go in to you wp-config file etc etc. THEN YOU ARE ALREADY IN THE SAME PLACE AS YOUR FUNCTIONS.PHP FILE!!? This just adds more work then necessary.
Where did you get the code for the clean dashboard?
I have a plugin where I've edited a JS file but I'm worried it will be overwritten if and when there is an update for that particular plugin. How do I go about using code snippets to insert my custom code (just a few lines) at the right place in that Javascript file using code snippets?
One of the themes (a while ago anyway) used to use "hooks" in a similar fashion. They would have a text area for stuff that was to go into the header, one for the footer and so on. They seemed to include those PHP functions outwith the text area. In their instance, that google An. code you pasted in would have been fine. So I'm with you on that - for noobs especially, have the functions pre-written/included and hidden. :)
Yes! A few themes / plugins did this. For example, TotalPress theme has hooks, and GeneratePress pro did this via a plugin somehow. The issue was that the hooks were really up to the theme author as to where they happened on the page / site - otherwise you're back to hacking at child themes and functions. 😱
Great video as usual, although I don't think that plugin can add snippets on a per page basis such as adding google analytics tracking code to the thank you page etc, but love your tutorials, keep them coming..
Hi wptuts,
I am stuck for so long on this one, hope
you have something that can help in this situation.
1. Created a front end form and acf repeater section for a table ( something like a pricing table)
2. Linked this to elementor section
3. Everything works as long as there is content in acf field.
4. If someone chose to not edit this table then the entire section need to be hidden as it will show some redundant headings and other stuff , I couldn't find a way to hide the entire section of acf field is empty?
Excellently done and very useful to know - Thank you! (and perfect for us retired IT folks who are happy enough using plugins -and code only when needed).
Is this code from your last tutorial?
Yes it is and can be found here: wptuts.co.uk/wordpress-developers-stop-doing-this/
Great Tut. Please send me link to Clean Dashboard code. THX Mike
As always a great video, Thank Paul! I am jealous of the hot tub!
Remarkably coherent! 🍻
Thank you, May God Bless you kind sir
Can you please create a website using Toolset ?
Hi Paul, please provide the coding for cleaning up the Dashboard, many thanks!
This was in the previous video
I noticed there is an “AB Test” admin menu item, what plugin is it for?
Thank you Sir... you dropped gems
The first rule of child theme.
If you don’t know why you would need child theme, you probably don’t need one.
Wrong. If you're really into WordPress you know that you're going to be needing one sooner or later.
@@christiandominiclangreo5101 You somehow say the same thing as me though.
You need to be "really into Wordpress" .
Like deeper level.
If you really need those extra custom style that pre-set with the planed idea . Then Yeah, Why not ?
Ah do Developers, please don't listen. Please Please don't make the "Complete Uninstall" checked as default. I believe he forgot how many times he had to disable all plugins to debug a site. If checked by default, you are good to reconfigure the plugin. I really don't want this activated by default.
Can you please give us a link to this code?
Here's the clean dashboard one.. wpbeaches.com/remove-wordpress-backend-dashboard-widgets/
Need to add the opening `
Sure, here you go. wptuts.co.uk/wordpress-developers-stop-doing-this/
@@badcatdesign Thank you very much.
Would rather have seen a video of you out drinking pints! WOO HOO! :) In all seriousness, thanks for the video!
🤣 Thanks Paul!! You're the best
Thanks for providing this. The Code doesn't get rid of OceanWp messages. I will be so happy if this gets rid of wpforms messages also ill have to report back on that. I hate wpforms with a passion bc of their stupid messages.
I use code snippets. I have never used a child theme
Great!
That intro 😄😄😄
Dude, your eyes... :))) you're so funny!
I don't believe you're drunk, what happened with your eyes?
why the hell would you want to put a ccs change in a function. You are adding to the stress on the sql calls and execution. Pretty much the same for everything through this plugin. It has to execute its own code in order to execute the user code. How the hell is this better for functionality and speed. If you can code you should just edit the file ( child ), wont slow the site anywhere near as much
Yep - as he mentions around 16:24 ... What could be a nice idea is if this plugin allowed a way to inject a TYPE of snippet (via shortcode?) to the proper location, page etc. This way for example, CSS gets dropped in to CSS, per page JS only runs... per page :) etc. Imagine saving a snippet, then being able to use that snippet's shortcode on a specific page.
I didn't say it was a good or bad idea, it is a demonstration of the function and if you do or don't want to use it then that's entirely up to you.
An upcoming Pro version will let you add CSS snippets to style.css instead of functions.php. And that not all we're doing to make your site faster and use (much) fewer plugins.
@@VerdiHeinz But you are still having to run your plugin to run code you could just effectively hardcode.
@@WPTuts Your title is Are child themes dead and your comment is yes so you are saying it is a good idea. Its still twice as much code to do the same thing as a child edited functions.php. A review and demo is fine but to infer its a better way is irresponsible.
If it was a plugin that allowed non coders to do the same thing then maybe in those cases it would be but you have to code snippets. People who do videos like this very rarely take into account the effects on performance etc, especially if the site it is being used on has high traffic and is already stretched and not optimized and hosted properly.
Cheers :)
big yikes