WordPress: Include Custom Post Type in RSS-Feed

Snippet:

 

WordPress: Adding custom columns to wp-admin posts overview

Adding custom columns to the posts overview from wp-admin is maybe simpler as you think.  You need just two hooks, one is an action named “manage_posts_custom_column” and the other one is a filter named “manage_posts_columns”.

Add custom column

With the filter “manage_posts_columns” you can add your custom column to the overview table of the posts. In my case I made the filter a little bit more complex, because I want control of the column order. The default order from wordpress is

  1. cb
  2. title
  3. author
  4. categories
  5. tags
  6. comments
  7. date
and normaly wordpress adds your custom column after “date”. In my filter function I walk with a while-loop through the default columns and add my column right after the “author” column:

If you have a more sexy solution for this, tell me :)

Adding content to your costum column

Next and final step is adding the content to your custom colum/row with the action-hook “manage_posts_custom_column”. The action takes the column-name and the post_id of the current row:

Custom columns only for a custom post type

If you want your custom column only in a custom posty, e.g. to display a custom taxonomy, then simply add the name of your custom post type to the name of the hook.

For example:

Action hook “manage_yourcustomposttypename_posts_custom_column”

Filter hook “manage_yourcustomposttypename_posts_columns”

Full example plugin code