[Edit This] Button on Posts and Pages
Put this in the theme file somewhere near where you output the_content() (likely in the single.php or page.php file) to […]
Activate cropping for all thumbnail sizes
This snippet is pretty handy if you want to crop your thumbnails instead of scaling them.
Add Additional Image Sizes
You can add as many indiidual image sizes to your WordPress site as you like by using the following function.
Add admin link for all settings
This snippet will add a “modify all wordpress site settings” link in the wordpress admin section.
Add category id to body and post class
This snippet is very handy if you wish to add category ID to body and post class for ex. targeting CSS styles and such.
Add class to first post in the loop
If you wanted to add emphasis to the first post in your blog adding this snippet to the functions.php of […]
Add Custom User Profile Fields
Heres a little trick on how to add custom user profile fields. Instructions Add this code to your functions.php file […]
Add Links to the WordPress Toolbar
This snippet add links to the wordPress 3.3 new toolbarst. Instructions Add this to your functions.php file of your theme. […]
Add search form to a specific wp_nav_menu
Adding this snippet to the functions.php of your wordpress theme will add the search form to your wordpress wp_nav_menu. Don’t forget to update the MENU-NAME to specify the menu you wish to display within, just in case you have multiple menus.
Add Theme Editor shortcut to admin bar
This snippet will add a shortcut link to your Wordpress theme editor.
Allow contributors to upload images
This snippet will allow your contributors to upload images to your site.
Allow contributors to upload images
This snippet will alloo contributors to upload images on your wordpress site.
Author List With Avatar Thumbnail
Heres a little tip on how display an author list with Avatars and username. Instructions Add this code anywhere in […]
Change the author slug, URL base
Adding this to the functions.php of your wordpress theme will change the default mysite.com/author/name to mysite.com/profile/name, however you can change […]
Change the default source of jQuery
This snippet will allow you to change the default source for your WordPress jQuery files. Instructions Add this code to […]
Change WordPress Login Logo
A quick little snippet to change the standard wordpress login logo to something of your own liking.
Custom Post Title length
This snippet will allow you to define a custom length post title in your template file.
Custom WordPress Admin CSS
This snippet will change the default style of WordPress admin area by overriding the old stylesheet.
Detect iPhone users
This snippet will help you detect your iPhone visitors and let customize your website and create a better experience for them.
Different admin and theme languages
Define one language for the admin section and another language for the end-user theme.
Disable dragging of metaboxes within admin
This snippet will disable all dragging of metaboxes within the admin.
Disable Plugin Updates
This snippet will prevent WordPress from checking if there’s any updates for your plugins. This could be useful if you’re […]
Disable wordpress version update notification
This snippet hides the Worpress version update message that is displayed when there is a new version of WordPress available.
Display Twitter followers count
This snippet grabs and displays the number of followers the specified user has.
Exclude a Custom Post Type from Search
Here is how to exclude a custom post type from search results.
Exclude Posts or Pages from Search Results
This snippet will allow you to control which posts or pages there should be excluded from WordPress search results.
Extend search to include custom post meta
This snippet extends WordPress search function to include custom post meta.
Force specific pages to be secure, ssl, https
You can easily force specific pages to be secure in wordpress using the following simple little snippet. Just add the […]
How to display custom fields with conditional statements
Sometimes you need to display post-specific content using custom fields. In this example we will show you how you can display custom field data using conditional statements in the form of a youtube video embed. If the post has a “youtube-video-link” defined, the content will be rendered.
How to Display Recent Posts From A Specific Category In WordPress
Heres a little snippet that will display recent posts from a specific category.
Include All Post Types in Search
This snippet will automatically include all public post types, that have not been excluded from searches in your search results.
Increase WordPress Memory Limit
If you get this message: “Allowed memory size of bytes exhausted” – it means you have too little memory allocated […]
Link to External Links from Your Post Title
Did you see other sites link to external posts from their post title? Well that is because it is completely […]
Modify WordPress img src for the “get_the_post_thumbnail”
Expose the WordPress “img src” part from the get_the_post_thumbnail, to modify the “img src” syntax. Instructions Add the following code […]
Multiple excerpt lengths
This snippet will allow you to set custom excerpt lengths in your excerpt tag in your template. Instructions Add this […]
Only display content on “front page”
If you only wish to show content only on the front page, you can do so by wrapping the content […]
Only show admin bar to administrators
Here a little snippet that will hide the wordpress admin bar from everybody except site admins.
Useful for sites that have public registration turned on.
Prevent WordPress to compress your jpg images
By default, WordPress compress uploaded jpg images. This is a good thing because it makes the files smaller, but in […]
Protect wordpress against malicious URL requests
This snippet is great for the security to protect wordpress against malicious URL requests.
Remove Author Prefix From Slug
Heres a little trick on how to remove the author prefix from the author slug. To clarify, this snippet will […]
Schedule cron jobs with WordPress
Here is how to run a cron job on at a specific interval by using Wordpress build in wp_schedule_event() function.
Set permalink settings from functions.php
Heres a snipet that allows you to set the permalink settings from the the functions.php file, rather than from the Wordpress admin backend
Set WordPress site offline for maintenance
This snippet will easy let you set your wordpress site offline by using the wp_die. This is a handy and […]
Setting Featured Image automatically
This snippet automatically sets the featured image by fetching the first image of the post.
Setup whitelist body_class to remove unwanted classes
This snippet will let you create a white-list of terms to include in body_class. This is a great way to filter out many of the unwanted css classes added.
Show most popular posts without a plugin
Heres a little trick on how to show a list of the most popular post by post read count – […]
Show number of queries and page load time
Heres a little nifty snippet that will show the number of queries made and the page load time.
Show Tag Cloud Quick & Hasslefree
A lot of people use the tag cloud widget in WordPress to show their post tags on their widgetized sidebar […]
Show widget area only if it exists
Heres a snippet on how to hide the sidebar container elements such as UL – if the sidebar has no widget active..
Templates with restricted user access
With this snippet you can create a page template restricted only to those users with the right role to access to it.
Theme Specific Conditional
This snippet can be used to target code for a specific theme only. A need feature if you want to execute conditional functions on ex. different devices and platforms.
Total pingbacks, trackbacks within admin post columns
This snippet will add a new column called counts within the admin post listing that will display the total number of pingbacks, trackbacks for each post.
Track & Show post views without plugin
This simple snippet tracks and shows post views in your templates – and without the need for a plugin.