Post Pagination in WordPress

Setting up post pagination in older versions of WordPress was a little tricky and more often than not required the use of a plugin. Thankfully since WordPress 4.1 a new function is available for displaying pagination with ease.

Modify footer text in WordPress Admin area

If you happen to develop sites for your clients in WordPress it is worth taking a few extra steps to customise the WordPress admin. Thankfully WordPress comes with lots of built in hooks to make this super easy.

Remove / disable textarea resize image

If you are a little OCD or have the need to stop your textarea from being able to be resized thankfully there is a super easy way to achieve this with the CSS `resize` property.

Linking to an image folder within a WordPress theme

During WordPress theme development you will more then likely need to display some images that are located within your theme directory.

The location of the images folder can vary greatly. It really comes down to how you like to set things up.

Force up and down arrow for number input

Those with a keen eye will notice that the up and down arrows for the number input doesn’t show up in Chrome (and some other WebKit based browsers) until you hover or are focused on the input.

To force the arrows to be visible we just need to change the opacity of the inner and outer spin button.

Better PHP Logging

If you are doing any kind of PHP development you will no doubt need to log out some values. Unlike JavaScript, logging out to the browser developer tools isn’t possibly as PHP is a server side language.

Adding Easy Digital Download Cart Quantity to Menu

When using the popular e-commerce plugin Easy Digital Downloads it is very common you will want to add the cart quantity to the menu. There are a few ways to do this but I have found adding it to the wp_nav_menu is great for styling consistency and maintainability.

Get URL with JavaScript

At some point in time you need to get the current URL and do some logic based on it. JavaScript has handy API called `window.location` which has all the information related to the windows current location.

Lazy loading images for flexslider

Flexslider is one of the most used sliders, for good reason. This snippet helps lazy load your images.

In order to create a perceived performance for users, we as authors shouldn’t allow the loading of every single image at once for sliders or carousels. In this snippet we only load the first and second image on init window load.