Setting a Default Theme for New WordPress Installations With WP_DEFAULT_THEME define( ‘WP_DEFAULT_THEME’, ‘default-theme-folder-name’ ); Enabling the “Trash” Feature for Media Files With MEDIA_TRASH define( ‘MEDIA_TRASH’, true ); Letting WordPress Skip the wp-content Directory While Updating With CORE_UPGRADE_SKIP_NEW_BUNDLED define( ‘CORE_UPGRADE_SKIP_NEW_BUNDLED’, true ); Allowing Unfiltered WordPress Uploads for Administrators With ALLOW_UNFILTERED_UPLOADS define( ‘ALLOW_UNFILTERED_UPLOADS’, true );
Can’t add new or delete plugins or do updates in WordPress?
If you can’t add new or delete plugins or do updates in WordPress and you have admin or appropriate privileges then the DISALLOW_FILE_MODS constant might be causing you problems if it has been set to true. Open up your wp-config.php (or possibly functions.php) file and look for the following line/code: Simply comment it out or change Full Article…
How To Check If function or class is avaliable or if a Plugin Is Active
Use the WordPress Function (is_plugin_active) You can use the built in WordPress function is_plugin_active to do the check. Here is an example where I check if Akismet is activated: if ( is_plugin_active(‘akismet/akismet.php’) ) { The catch : you need to know the directory and file name of the plugin. The directory could differ if the plugin was Full Article…
Query Posts Ordered By Author Last Name
This is untried and taken from Stack Exchange: http://stackoverflow.com/a/22056861/2821561
How To Limit The WordPress Posts Screen To Only Show Authors Their Own Posts
When working on a multi-author WordPress blog, the post listing screen can get a little bit crowded. Sometimes you have to hunt through many posts that are not your own before locating a draft you’ve been working on. Here’s a quick way that you can change the posts page to show only the author’s own Full Article…
How to stop PHP notices from appearing on the front end of your WordPress website?
You need to edit your: wp-config.php file and modify the following here:
Trim Your Text with wp_trim_words() in WordPress
Today, I discovered that WordPress 3.3 actually has a similar core function called wp_trim_words(). The function works like so:
Get a taxonomy term object by it’s slug
Set up the object for the taxonomy term: Then you can use the object like this: Here’s everything available in the object:
Nested loops with WP_Query
I struggled with this for a while and then realised the post object of the current query needs to be saved to a temporary variable [$save_original_post_object = $post;] so it can be restored after the nested loop is finished [$post = $save_original_post_object;]. Additionally you need to setup a new post object in the nested loop Full Article…