WordPress.org

Ready to get started?Download WordPress

Forums

Custom Field Template
Am I missing something? (5 posts)

  1. Nadavr
    Member
    Posted 1 year ago #

    Hi everyone. I've been trying to create a functioning custom field template with this plugin for quite a some time, but has been unsuccessful and am beginning to think that maybe I'm missing an important step or something. I wanted to create a custom post type for hotels, with two extra TinyMCE editors. The problem is they never show up in the front end. This is going to be a bit of a long post but if you have a minute please take the time to tell me if I've missed some important step, because frankly this plugin is giving me a hard time.
    Here is what I did so far: I initialized a new custom post type in the functions.php. The new hotel custom post type appeared just fine in the CMS. I then created a custom field template with two TinyMCE editors using this plugin. What I wrote is as follows:

    [gallery-text]
    type=textarea
    tinyMCE=true
    cols=50
    label=Gallery Text
    
    [hotel-list]
    type=textarea
    tinyMCE=true
    cols=50
    rows=15
    label=More about the hotel

    Lastly I wrote the name of my custom post type (hotel) in the custom post type field for that template. Now the custom field template is available in the hotel post type (although for some reason it doesn't autoload). But even though I can fill the new fields and save them they don't show up in the front end. Help please?

    http://wordpress.org/extend/plugins/custom-field-template/

  2. Hiroaki Miyashita
    Member
    Plugin Author

    Posted 1 year ago #

    In order to output the custom fields, you need to use the shortcode or php code directly. It is easy to use the shortcode in the post content like this.

    [cft key="gallery-text"]
    [cft key="hotel-list"]
  3. Nadavr
    Member
    Posted 1 year ago #

    Thank you for the explanation. Can you please also give me an example of how to use a direct php code or which file should I edit to add the code?

  4. Daniel Payne
    Member
    Posted 6 months ago #

    For PHP code use this:

    get_post_meta( $post->ID, 'gallery-text', true );

  5. r.glenn.nall
    Member
    Posted 5 months ago #

    this is one FANTASTIC plugin, especially for many of my stupider clients.

    only drawback - why are great plugin developers so crappy at explaining how to use the plugin???

    a "[cft key="gallery-text"]" as an example might have been a good idea!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic