Support » Plugin: Custom Content Type Manager » Shortcode in Custom Field

  • I created a customer field for a shortcode.
    I entered the following in the field: [widgetkit id=”2″]

    I tried different outputs but just got “array” or “[widgetkit id=”2″]”

    What do I need to set the output to in order for the shortcode to render correctly? It is suppose to display a slide show.

    I put this in my template file: <?php print_custom_field(‘widgetkitshortcode’); ?>

Viewing 1 replies (of 1 total)
  • If the field is only to contain the shortcode, you use this:

    echo do_shortcode( get_custom_field( 'widgetkitshortcode' ) );

    If the field also contains text and you want the shortcode to be processed just like in the_content, use this:

    echo apply_filters( 'the_content',get_custom_field( 'widgetkitshortcode' ) );

Viewing 1 replies (of 1 total)
  • The topic ‘Shortcode in Custom Field’ is closed to new replies.