wordpress snippets last updated   : October 6, 2014
we now have 641 snippets

Add select menu to filter by custom field in admin

wordpress snippet

WordPress is full of some great features, although sometimes you need to add something extra like the following snippet making WordPress just a little easier to use. This snippet will add a new custom field select menu to your WordPress post, page listings. The menu will display a list of all custom fields, just select the field you want to filter by. This snippet is only for the wp-admin however If you wanted to do any sort of filtering on the front end of your site. View the following snippet that will let you filter by category using search.

read more

Disable Tinymce HTML editor excluding array of users

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will disable tinyMCE for everyone but the specified list of users. This is an updated version of this snippet ( Disable Tinymce ).

read more

Automatically categorize and tag posts when saved

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will let you automatically categorize and tag posts when you save them. Don’t forget to add a new tag or a new category

read more

Google charts shortcode, lines, xyline, sparkline, meter, scatter, venn, pie, pie2d

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will create a new shortcode that takes advantage of the Google charts API. This shortcode will let you display a range of charts “lines, xyline, sparkline, meter, scatter, venn, pie, pie2d” See the below shortcode example of a 3D pie chart. Change the type attribute in your shortcode to specify the type of graph you wish to display.

read more

Change admin area “pagination” posts per page

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will let you adjust the number of posts display within the admin area. By default wordpress will display 20 posts at a time within the admin area but you can change the number for the variable $per_page to display more or less.

read more

Add admin post column with wp_get_shortlink

wordpress snippet

Add the following snippet to the functions.php of your wordpress theme. This snippet will add a new column to the posts screen with an input field containing the wordpress shortlink. I added a little javascript to auto select the text.

read more