How Lambdas can be useful in Java

I’m revising for the OCP (Oracle Certified Professional Java Programmer ), and running over Lambdas at the moment. In tutorials I see many of them seem to focus on what they are , what they do , streams etc. Not much on how they can be used to improve code ( and making less Class … Read more

Adding javascript functions to Laravel Mix ( and why you get error Uncaught ReferenceError: function is not defined )

This one had me pulling my hair out the other day. I was using Laravel,  adding a javascript function to the app.js file ( also tried using require in app.js and pulling in my function ). Laravel uses Laravel Mix which is a wrapper for webpack. Yet with either approach I was getting the javascript … Read more

How to override the comments form in a child theme

This is a quick post on how to provide your own comments template in your child theme ( overriding comments.php in your parent theme). You can just as easily use the same code to override comments.php if you aren’t using a child theme. Todo this you need to you need to use the filter ‘comments_template’ … Read more

How to get a users Roles and how to list all WordPress roles in PHP

This code is handy if you want to find out a users role/s. You could expand it and check if a user has a given role or similar. $user_info = get_userdata(2152); echo ‘Username: ‘ . $user_info->user_login . “\n”; echo ‘User roles: ‘ . implode(‘, ‘, $user_info->roles) . “\n”; echo ‘User ID: ‘ . $user_info->ID . … Read more

How to make a WordPress Theme, Woocommerce Compatible from scratch

beginners guide to theming Woocommerce

In this post I’ll going to explain how I took a WordPress Bootstrap Theme and made it Woocommerce Compatible. I couldn’t find many good tutorials on this so I’m writing this one, so that it might help someone else. The Process to make a theme Woocommerce Compatible I’m going to take the very nice DevDmBootstrap3 theme and make it Woocommerce … Read more