Tag Archives: post
Many developer used Property, Car, Product and several others as a custom post type which, by default, sorted by publishing date (very odd). This fairly simple snippet details how one can add a sortable numeric column (for example a pricing column) in listing view of custom post type. It is quite useful as custom post types are getting popular day by day.
This is an advanced version of default in_category function. This function not only check for existance of post in the specified categories but also in all the subcategories down in the tree. It has same in_category parameters So you can use it in replacement of in_category.
If you want to have different look and feel for post one after the another. This snippet will let do that quite easily. It will add “alt” class to alternative posts and you can then change, lets say, background color or border to make it different from the adjacent posts.
This short snippet requires authors and admins to set a post thumbnail before publishing any article. It will update the post and all of its contents but wont publish it until the thumbnail is set. For custom post types, you just need to change the “get_post_type” condition to your custom post type.