Putting Custom Fields in a template

How do I echo the value of custom fields in to a template.

I tried this:
echo do_shortcode('[Condo HTML Markup]');
echo do_shortcode('[_ct_text_542d4c553eb9d]');

Neither work. Your demonstration only demonstrates the use of the shortcode in a post loop. Not in a template. Though it mentions it. Furthermore the instructions are half baked in the plugin. They refer to the Field ID in the table but ask you to put the custom_field_block in the shortcode.

You should use the same terminology. How does anyone know what you are asking for?

Embedding Custom Fields
Embed codes are used in templates to return the value of the custom fields of the current post. Codes may be for individual fields using the Embed code links below for each field
or you can display the entire block of custom fields for a listing using the embed code:
<?php echo do_shortcode('[custom_fields_block]'); ?>

Shortcodes are used in post, pages and widgets to return the value of the custom fields of the current post. Use inside the loop in Posts and Widgets
[custom_fields_block]

That is what is in the plugin under the custom fields tag. It needs to use different terminology so we know what is being asked.

  • Joseph

    I found the solution.

    For everyone that finds this thread...

    The instructions are very misleading. The answer is there though. In the plugin, when you are looking at the custom fields there is a link that says "embed code".

    To embed the shortcode in to a template you use the code that has <?php echo do_shortcode(); ?>

    The instructions for this plugin are very confusing. If you don't push the embed link, you see the embedding instructions above. They tell you to

    <?php echo do_shortcode('[custom_fields_block]'); ?>

    In the embed link, for each individual custom field they tell you to
    <?php echo do_shortcode('[ct id="_ct_text_542d4ae3cc544" property="title | description | value"]'); ?>

    Which works. I could say a lot more. The custom press main page usage doesn't even cover the use of the shortcode in template files. The Custom Press plugin tells you that the above solution works inside the loop in posts and widgets. Any WP user would assume that it would only work IN the loop. Not the case.

    Please make a note that this stuff needs to be updated, specifically.

    Thanks Jack for getting to me so timely. Great support WPMU.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.