Home › Forums › Calendar Products › Events Calendar PRO › Custom Fields
- This topic has 7 replies, 4 voices, and was last updated 10 years, 9 months ago by
Support Droid.
-
AuthorPosts
-
December 12, 2011 at 9:11 am #12135
Mike
ParticipantIs there a way to add in the custom fields that I have set up for my regular posts into the event posts. Basically I use a custom field to group together various posts & pages and would like to be able to include events in this output.
December 12, 2011 at 2:45 pm #12151Rob
MemberHey Mike, let me see if Jonah has any suggestions. I don’t believe this is possible without quite a bit of customization but I’ll let him comment for certain.
December 12, 2011 at 8:42 pm #12187Jonah
ParticipantHi Mike,
Do you have some examples you can provide of your code so far so I know what I’m working with? I.e. what is the code you are using to have the custom fields for your regular posts?
Regards,
JonahDecember 13, 2011 at 3:36 am #12195Mike
ParticipantHi Jonah,
I’m not using any custom code to achieve the additional custom fields, just the built in ‘Add new custom fields’ meta info to apply a field name and its value.
In the page/post templates I’m using get_post_meta() to test if a post/page has a particular meta value and then to treat it accordingly.
Clear as mud? Good.
December 13, 2011 at 6:53 am #12200Jonah
ParticipantHi Mike,
Clear as mud, thank you! While we don’t add support for custom fields in the current version but will be doing so in 2.1 there is an easy workaround for now. Just add this to your functions.php file:
/* Adds custom field support to Tribe Events */
add_action('init', 'my_custom_init');
function my_custom_init() {
add_post_type_support( 'tribe_events', 'custom-fields' );
}
I would also highly suggest taking a look at the wonderful Advanced Custom Fields plugin to make working with custom fields much easier: http://plugins.elliotcondon.com/advanced-custom-fields/
Regards,
JonahDecember 14, 2011 at 3:41 am #12267Mike
ParticipantHi Jonah,
Thanks for the code that’s brilliant, works a treat. Also for the link to the advanced-custom-fields plugin, looks great but maybe a bit much for what we need.
Cheers!
December 14, 2011 at 7:52 am #12286Rob
MemberAwesome to hear, Mike! Glad to see you got this working. Let us know if anything else comes up going forward.
July 2, 2015 at 5:00 pm #974902Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Custom Fields’ is closed to new replies.
