Register New Sidebars in WordPress

Today, I’ll show you how to register new sidebars in WordPress, which can be used to add new widgets areas for use across a website such as in custom page templates, footers and just about anywhere. It’s a 2 step process, so let’s get started on step 1. 1. Register the sidebar In either functions.php … Continued

Remove Related Videos From WordPress oEmbed Youtube Videos

If you’re embedding videos into WordPress, possibly as a post, you may sometimes want to add parameters to the code to overwrite the oEmbed default behaviour of WordPress. This can be achieved by creating your own plugin or adding this snippet to your functions.php file. This example removes the related videos at the end of … Continued

Change locale in WordPress SEO to EN_GB

A client this morning emailed me to ask how to change the locale of her website from the default en_US language to the UK version while running the Yoast WordPress SEO plugin. While some people think that by installing WordPress as the UK version does this, it doesn’t. This only really alters the language file … Continued

Adding a Contact Form 7 form into a PHP template in WordPress

Sometimes you may want to add a contact form 7 form into a template directly. While normal use is via a shortcode eg, you can’t use this directly inside a PHP page template. Instead, you need to wrap this inside the WordPress do_shortcode function, in order to enable it to parse correctly. Wrapping your form … Continued

Add Category ID into the body and post class in WordPress

Here’s a little snippet I regularly use to add the ID of the post/page into the body class and post class. It’s really helpful to aid targeting specific things in CSS, add functionality with javascript and to quickly pinpoint the ID of a page without checking through the back-end. Add this to your themes functions.php … Continued

Call Google’s jQuery Library in Your Template

Why use your own bandwidth when you can use Google’s own! This snippet ensures your WordPress website correctly calls the Google jQuery library direct from Google for speed, security and reliability: NB: Just make sure you use the above with… …in your header file, or wherever your wp_head scripts get called from.

Remove the admin bar from the front-end of WordPress

This little snippet removes the admin bar permanently from all users while logged in and viewing the website from the front-end. Personally, I never use it and always turn it off with this little snippet.

Remove Error Message on WP-login to increase security

Hackers and bots are more prevalent than ever. It is vitally important you protect your WordPress install from every type of potential attack. One simple way hackers attempt to get into your install is via the login form. Most people stick with ‘admin’ as the default username for their admin account. This is bad. Already, … Continued

Make Woocommerce Products Sold Individually By Default

So one of my new personal websites sells virtual products where customers buy just one product at a time. I don’t need quantities and nor do I want quantity boxes on the product page or the checkout, there just no need for it. So there could be a way to bring in some jQuery into … Continued