Get WordPress Thumbnail URL, Width & Height

Simple function to get the current post’s thumbnail/featured image, but to return it as an array so you can get the thumbnail url, the thumbnail width and the thumbnail height. In the example I’m getting it to use the thumbnail with a lazyload script (specifically this one Replace thumbnailsize with either the name of […]

List Buddypress Groups Of Current Logged In User

Returns a list of the groups the current logged in user is a member of

Buddypress Logged-In User Profile Link URL

Returns the url of the logged user’s profile e.g. <p>You can check out your <a href="<?php bp_loggedinuser_link() ?>"><u>profile here</u></a>.</p>

Override and set the Facebook open graph locale the Yoast WordPress SEO plugin puts in the WordPress head

The Yoast WordPress plugin adds the Facebook open graph markup to your WordPress head if you enable it. It takes the locale setting from whatever language you have set in the WordPress general settings. You can change it in the settings to whatever locale you need or, if you want to keep the WordPress language […]

Remove Yoast WordPress SEO plugin’s search schema markup from the WordPress head

Add this to your theme’s functions.php to remove the search schema that the Yoast WordPress SEO plugin puts in the WordPress head. Particularly if you’re not using the WordPress search on the site!

Remove WordPress emoji scripts from head

Removes the new emoji scripts which are in the head from WordPress 4.2 up. Put this in your theme’s functions.php

Disable All WordPress Automatic Background Updates

To completely disable all types of automatic updates, core or otherwise, add the above to wp-config.php file:

WordPress conditional for custom post type

A simple conditional if statement for custom post types i.e. display different content if it’s the defined custom post type. Just replace custom-post-type with the ID you have given your custom post type in register_post_type within your theme’s functions.php (usually) and then echo the content you want blah blah.

WordPress simple list of the current posts tags

Simple function to print a list of tags which the current post is tagged with e.g. Outputs: <ul> <li><a href=”http://taglink1″ rel=”tag”>Tag 1</a></li> <li><a href=”http://taglink2″ rel=”tag”>Tag 2</a></li> <li><a href=”http://taglink3″ rel=”tag”>Tag 3</a></li> </ul>

WordPress simple get post meta

This function returns the values of the custom fields with the specified key from the specified post. This is the simplest method of simply echoing out the value of a WordPress custom field on a post or custom post. Just replace custom-field-name with the name of the desired custom field you want to echo out.