jQuery

Static email addresses to links

This is how to use jQuery to automatically convert all email addesses from static text into a mailto link. In this example we are looking for all emails in the .email_list class. Usage: var regEx = /(\w+([-+.’]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)/; $(“.email_list”).filter(function() { return $(this).html().match(regEx); }).each(function() { $(this).html($(this).html().replace(regEx, “<a href=\”mailto:$1\”>$1</a>”)); });

View Chunk »
The Loop

Password Protect Custom Templates

If you have a page template that does not use the standard the_content(); code or you have custom fields on the page you want to hide, you can simple add this code: Usage: global $post; get_header(); if ( ! post_password_required( $post ) ) : // Paste page content here else : // Password form echo […]

View Chunk »
Custom Post Types

Check if is Post Type

Here are a few handy “if” statements to show particular content based on the Custom Post Type.

View Chunk »
Functions

Remove Gutenberg Editor

Revert to the original WYSIWYG editor in the Wordpress Admin

View Chunk »
The Loop

Loop: Custom Taxonomy

This chunk lists all the Categories or Taxonomies of a Custom Post Type. You can also get ACF fields.

View Chunk »
Wordpress

Check if Cookie is set

See what cookie data your website is storing in the browser.

View Chunk »
The Loop

If Post has content

This little chunk of code will only show the Post or Page content if there is anything.

View Chunk »
Functions

Allow HTML in Category Description

This chunk allows you to add HTML to a Post Category or Custom Post Type Taxonomy.

View Chunk »
CSS

CSS: Flex

Using Flex is a really simple way to align elements inside a div.

View Chunk »
Functions

Remove Gravity Form Labels

Often forms can look nicer if they have placeholders instead of labels. Especially on smaller less complicated forms.

View Chunk »
jQuery

jQuery: Tabs

Adding tabbed content is a great way to organise a page.

View Chunk »
ACF

ACF: Repeater Fields

Advanced Custom Fields (ACF) cheatsheet for repeater fields

View Chunk »
ACF

Slideshows with Cycle2 & ACF

Creating slideshows with Cycle2 & Advanced Custom Fields

View Chunk »
CSS

CSS: Border-radius

The border-radius allows you to add rounded corners to elements

View Chunk »
CSS

CSS: Gradients

CSS gradients let you display smooth transitions between two or more specified colours.

View Chunk »
HTML

Retina Images

Add Retina and Responsive images using the srcset attribute in the image tag.

View Chunk »
Functions

Search Form into Shortcode

Here is an easy chunk of code that allows you to put the Search Form Widget or get_search_form(); anywhere using a Shortcode.

View Chunk »
Functions

Custom Search Form

Here is a simple way to customise the default Wordpress output of the Search Form.

View Chunk »
Widgets

Change Categories Widget

Here is an easy way to change how the Category Widget outputs HTML.

View Chunk »