PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Custom Fields GF or functions.php?

  1. I can see that it is possible to add a custom field to a custom post type if using GF for user submitted content. My question is what are the pros and cons of that over adding one in functions.php I can already see that adding meta boxes through functions.php is way much more coding (a little above my head) but I would do that if it was better than adding them through a form.

    Thanks

    Martin

    Posted 11 years ago on Tuesday April 2, 2013 | Permalink
  2. I'm not sure I understand the question. Can you tell us what information you want to capture in your form, and where you want to store it? We can help you better with that information.

    Posted 11 years ago on Tuesday April 2, 2013 | Permalink
  3. Oh, sorry,

    I have a form that submits a custom post type called listing. If I want to capture the organisation's address I can use an address field and then a create custom template to pull the information into the post.

    Or now I am thinking that it would be better to use a post field, custom field to create a custom field in the post and although I can't do it yet, I think that might give a bit more control about how the submitted data can be used.

    So now I can see that I can add my own custom field and meta box in WordPress which is the trickiest way for me and my question is what is the difference between using a GF Post Field, Custom Field over a WordPress custom built meta box?

    I hope I got the terminology correct there. I haven't implemented this yet. The reason I am asking is that if there is no advantage in coding a custom field meta box then I'll stick with the GF model.

    Thanks

    Martin

    Posted 11 years ago on Thursday April 4, 2013 | Permalink
  4. Hello Again,

    I still would like to know if there is any benefit at all in using a custom field generated by a form or one added using functions.php

    In the mean time, I am now trying to call a custom field and neither of these two lines of code do it:

    echo get_post_meta($post->ID, 'towns', true);
    
    		 $key="towns"; echo get_post_meta($post->ID, $key, true);

    Each of those returns, Type Town"

    Posted 11 years ago on Sunday April 7, 2013 | Permalink
  5. Sorry about this. Those two snippets of code work. I'm embarrassed to say that Type Town was the value and that I had entered it in a test submission. doh!

    If possible, I would still like to hear about the pros and cons of a GF custom field and a coded one.

    Thanks

    Posted 11 years ago on Monday April 8, 2013 | Permalink