Jump to content


Photo

Adding Custom Fields to the Features Custom Post Type


  • Please log in to reply
3 replies to this topic

#1 pfflyer

pfflyer

    Member

  • Members
  • PipPip
  • 21 posts

Posted 10 August 2011 - 03:34 AM

I have run into this problem before: various WordPress plugins attach themselves to Single Posts. Thus, they attach to the custom post types and basically mess up your Features, etc. Now some plugins have been savvy enough to create a key and value you can use to shut them off on particular posts. However, the custom field section is not available on the Features Custom Post Types screen. Is there a way I can do that myself by adding something to the code? Or is this an issue the Pagelines team will have to think about? Thanks in Advance.

#2 Kate

Kate

    Advocate

  • Members
  • 3039 posts

Posted 10 August 2011 - 01:23 PM

I can see that custom fields aren't available by default, however, I know they can be added to custom post types. However, off the top of my head, I'm not sure of the best approach to do that with this already defined feature post type :) I'm marking this for the developers...

#3 pfflyer

pfflyer

    Member

  • Members
  • PipPip
  • 21 posts

Posted 10 August 2011 - 03:53 PM

Let me know what the developers say. I have done some research and could probably customize it myself. I just hate doing that though because I know i will forget it is there the next time I upgrade!

#4 kastelic

kastelic

    Advocate

  • Members

  • 3081 posts
  • Country: Country Flag

Posted 10 August 2011 - 11:23 PM

Hi, activate platformbase and then paste this into platformbase/functions.php
 
		//Adds support for custom fields to Feature post type
		add_action('init', 'my_custom_init');
		function my_custom_init() {
			add_post_type_support( 'feature', 'custom-fields' );
		}