Check if email is valid $email = '[email protected]'; // email address which we are verifying if ( is_email( $email )...
Force SSL on custom post types This snippet tells WordPress to use a SSL connection if a single page from custom...
Restrict content to logged in users shortcode This function creates a shortcode which limits access on your site. Content wrapped in...
Query: exclude child categories of a specific category You can exclude children posts on your homepage of category 21 with this function. It...
List posts from same category This goes inside the loop on single.php - This lists all the posts in the...
Add admin script on custom post types if you require a specific javascript file enqueued only on pages related to your custom...
Check if post has a gallery A simple check if the current post\page has a gallery shortcode within the post_content. Show...
Load script on custom page template This snippet loads a custom javascript file only if a conditional tag is true. In...
Limit CPTs per page on homepage What would we do without the pre_get_posts filter? Another handy WP snippet to customize the...
Conditional check for all custom post types By default we can use " if ( is_singular( 'book' ) )" to check for...