Tag Archives: custom post

sorting

Snippet: Numeric sortable column for custom post type in admin panel

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.

require-featured-image

Snippet: Require Post Thumbnail to be Uploaded Before Publishing

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.

media-metabox-fi

Snippet: Media Metabox to add additional images to posts

This snippet adds a gallery metabox where admin can either upload images through WordPress Uploader or put in the image URL directly. This metabox is very useful for the custom post types for which you want to upload multiple images. Some good examples are, real estate properties, work portfolios and store products. All of these would have a featured image and some images to be displayed in a (for example) slider to explain it features and qualities.

Admin Widget of to Display Future Posts

Widget: Display Future or Upcoming Posts

This widget allows you to display scheduled posts or custom post type. You can limit number of posts to display and toggle to display thumbnail, link to the post and change the order of the posts.

track-post-views

Snippet: Track Views of Posts, Pages or Custom Post Types without Plugin

This snippet automatically track views of posts, pages and custom post types. You can use get_post_views function having optional $post_id parameter to fetch the number of views of any post, page or custom post type. You can also add “Views” column in admin panel for each post type.

Snippet: Add default content to posts in a specific category

Add following snippet to “functions.php” Snippet

tinymce

Snippet: Readonly TinMCE for selected post types

Add following snippet to “functions.php” Snippet