Login with Username or E-mail
This functions code snippet adds the option to login with the username OR your registered email. By default WP requires a username. WPcustoms
View ArticleRequire a Featured Post Image
This code sends an admin message if a featured image is not set for the current post. If no image exists it will save the post as draft. WPcustoms
View ArticleRequire Minimum Comment Length
Paste this code into your WordPress functions.php file to require a minimum comment length. Adjust the '20' to set the required characters. WPcustoms
View ArticleHow to display current post taxonomies and terms
display all the taxonomies of the current post with attached terms WPcustoms
View ArticleFunction to add a HOME link to your primary navigation
This function creates a custom link in your primary navigation. You can modify it and add more links or insert any other html to your menus WPcustoms
View ArticleForce a minimum password length at checkout
Force an 8 letter minimum password length for easy digital download customer signups WPcustoms
View ArticleGet theme info from style.css
If you want to show theme infos in your template you can grab them with these codes. WPcustoms
View ArticleCreate new image sizes for custom post types
By default WordPress creates three images sizes for every picture uploaded to your media library. If you want to create a new size for custom post types you can copy this code to your functions file....
View ArticleRandomize your posts
Add this code snippet to your functions.php file. It jumps into the pre_get_posts hook and add the argument "orderby=rand" to the main queries. This way your posts get randomized in its order. Feel...
View ArticleShow current child category in template
This function displays the post's current child category name. WPcustoms
View ArticleModify “Category:” from the_archive_title
This function jumps into the hook the_archive_title to help you to modify the default output from archive pages titles WPcustoms
View ArticleCheck if email is valid
$email = 'testemail@gmail.com'; // email address which we are verifying if ( is_email( $email ) ) { echo 'valid email.'; }else { echo 'not a valid email'; } WPcustoms
View ArticleAdd download category and tag to post class
These two functions will add the download category and the download tag slug to the post_class. A good helper for custom css settings if a download item has a specific category like 'featured' or...
View ArticleList download categories with EDD
If you are using EasyDigitalDownloads plugin you may want to build a template which lists all download categories. This function prints an ul-list for each category you've set in your EDD downloads....
View ArticleAdd welcome message to wp-login
This function inserts custom html below the logo on your wp-admin\ wp-login.php site. Add any html codes your project requires. WPcustoms
View ArticleForce SSL on custom post types
This snippet tells WordPress to use a SSL connection if a single page from custom post types is visited (in this example, movies and books). Adjust as required and check out the codex for...
View ArticleMark long comment URLs as spam
If a comment author URL is longer than 50 letters WordPress automatically marks it as spam with this short function. WPcustoms
View Articleautomatically add custom meta field values to posts
Auto-add custom meta field values with this function to all posts. This can be extended as required and i.e. add the authors nickname as a custom meta field. Options are endless and this gives you a...
View Articlewp-admin: Rename ‘Post’ to ‘Article’
Some sites require to rename the Posts menu item to something different. This snippet gets that part done. Adjust the 'Article' text to anything you want your default posts to be named. WPcustoms
View ArticleAdd custom RSS Feed to dashboard
This function removes the default WordPress feeds. The second function adds your custom feed url to the admin dashboard. Customize as required. WPcustoms
View Article