Title: [Plugin: Custom Content Type Manager] Using shortcode in text area
Last modified: August 20, 2016

---

# [Plugin: Custom Content Type Manager] Using shortcode in text area

 *  Resolved [jumust](https://wordpress.org/support/users/jumust/)
 * (@jumust)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-custom-content-type-manager-using-shortcode-in-text-area/)
 * Hi,
    I’m using some shortcodes that I created with a plugin to display few icons.
 * I set up with CCTM some custom fields as text-area and the default output filter
   as None (raw)
 * If I add all those shortcodes to the default editor of WordPress they display
   correctly the image but if I add them in the text-area of CCTM they show up with
   the shortcode.
    If I was not clear I’m adding here a screenshot [http://screencast.com/t/4tuTAK9Vb](http://screencast.com/t/4tuTAK9Vb)
 * Also if I push the button shortcode in the HTML editor it doesn’t even work, 
   only works with default WP editor
 * Please advice as I set up many Custom fields with your plugin and now it’s definitely
   necessary to use shortcode within them. I might want to ask you for a custom 
   work if it was not included in your plugin as I think this option should be obvious.
 * Thanks a lot!
 * [http://wordpress.org/extend/plugins/custom-content-type-manager/](http://wordpress.org/extend/plugins/custom-content-type-manager/)

Viewing 12 replies - 1 through 12 (of 12 total)

 *  Plugin Contributor [fireproofsocks](https://wordpress.org/support/users/fireproofsocks/)
 * (@fireproofsocks)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-custom-content-type-manager-using-shortcode-in-text-area/#post-2855405)
 * By default, WordPress parses shortcodes ONLY in the main content block. If you
   use shortcodes in your own WYSIWYG field (or anywhere else), you’ll need to use
   the “do_shortcode” filter: [http://code.google.com/p/wordpress-custom-content-type-manager/wiki/do_shortcode_OutputFilter](http://code.google.com/p/wordpress-custom-content-type-manager/wiki/do_shortcode_OutputFilter)
 *  Thread Starter [jumust](https://wordpress.org/support/users/jumust/)
 * (@jumust)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-custom-content-type-manager-using-shortcode-in-text-area/#post-2855410)
 * Thanks!I’m trying to figure that out with the code I’m using. I built this piece
   of code basically with your suggestion at that time, now can’t understand how
   to edit it with the shortcode function, it’s breaking the page
 *     ```
       <?php
       								print wpautop( get_custom_field('contatti:wrapper'
       								  , '<div class="one_half" style="margin-bottom: 25px;">
       								  <hr class="section" /><span class="tag_section">Contatti</span><hr class="section" /><div style="margin-top:25px;">[+content+]</div>
        								 </div>'
       									 )
       								);
       							?>
       ```
   
 *  Thread Starter [jumust](https://wordpress.org/support/users/jumust/)
 * (@jumust)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-custom-content-type-manager-using-shortcode-in-text-area/#post-2855443)
 * [@fireproofsocks](https://wordpress.org/support/users/fireproofsocks/) any idea
   what are the steps I need to get it working.
    Now I can’t use shortcode in WYSIWYG
   field created with your plugin
 * What I wanna do is to have also text in the WYSIWYG and not only shortcode.
 * Thanks a lot!
 *  Plugin Contributor [fireproofsocks](https://wordpress.org/support/users/fireproofsocks/)
 * (@fireproofsocks)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-custom-content-type-manager-using-shortcode-in-text-area/#post-2855444)
 * By default, WordPress does not parse shortcodes anywhere EXCEPT in the main content
   block. You need to use the do_shortcode() function to parse shortcodes elsewhere.
   See the do_shortcode filter: [http://code.google.com/p/wordpress-custom-content-type-manager/wiki/do_shortcode_OutputFilter](http://code.google.com/p/wordpress-custom-content-type-manager/wiki/do_shortcode_OutputFilter)
 * In your example, you’re using the “wrapper” output filter and some custom WordPress
   modifications… so it’s kinda a mess. Either use the CCTM’s output filter or use
   WP’s do_shortcode function: [http://codex.wordpress.org/Function_Reference/do_shortcode](http://codex.wordpress.org/Function_Reference/do_shortcode)
 *  Thread Starter [jumust](https://wordpress.org/support/users/jumust/)
 * (@jumust)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-custom-content-type-manager-using-shortcode-in-text-area/#post-2855445)
 * Thanks! I’m not expert and I built that code earlier asking in this forum suggestions
   because I don’t know how to write that code actually.
 * The thing I need is that the custom field disappear on the website if there is
   not content posted there in the admin, I remember maybe that someone told me 
   to add print wpautop….so I don’t even know why I put it there.
 * Than I added my class and div, easier for me.
 * So what should I use to get shortcode working and make the field disappear if
   there is not content?
 *  Plugin Contributor [fireproofsocks](https://wordpress.org/support/users/fireproofsocks/)
 * (@fireproofsocks)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-custom-content-type-manager-using-shortcode-in-text-area/#post-2855446)
 * Do something like this:
 *     ```
       <?php
       	print_custom_field('contatti:wrapper:do_shortcode'
       	  , '<div style="margin-top:25px;">[+content+]</div>');
       ?>
       ```
   
 * You can chain output filters (see [http://code.google.com/p/wordpress-custom-content-type-manager/wiki/OutputFilters](http://code.google.com/p/wordpress-custom-content-type-manager/wiki/OutputFilters))
   so I just added the do_shortcode filter after the wrapper filter.
 * Or if you wanted to use WP’s raw function:
 *     ```
       <?php
       	do_shortcode(get_custom_field('contatti:wrapper'
       	  , '<div style="margin-top:25px;">[+content+]</div>')
       	);
       ?>
       ```
   
 *  Thread Starter [jumust](https://wordpress.org/support/users/jumust/)
 * (@jumust)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-custom-content-type-manager-using-shortcode-in-text-area/#post-2855447)
 * Perfect it works thanks!
 *  [pzula](https://wordpress.org/support/users/pzula/)
 * (@pzula)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-custom-content-type-manager-using-shortcode-in-text-area/#post-2855498)
 * Just curious as to how to get do_shortcode to work in my textarea (using the 
   Editor option on Custom Content Type) the WP documentation on the subject is 
   pretty sparse. I tried
    `<?php echo do_shortcode( 'ecpt_My_Field_Name' ) ?>` 
   to no avail.
 * Thank you!
 *  Plugin Contributor [fireproofsocks](https://wordpress.org/support/users/fireproofsocks/)
 * (@fireproofsocks)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-custom-content-type-manager-using-shortcode-in-text-area/#post-2855499)
 * WP’s do_shortcode function has caused me many headaches. But you need to run 
   it on a string containing a shortcode, e.g.
 * `<?php print do_shortcode( get_custom_field('my_custom_field') ); ?>`
 *  [pzula](https://wordpress.org/support/users/pzula/)
 * (@pzula)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-custom-content-type-manager-using-shortcode-in-text-area/#post-2855500)
 * Is it possible for WP 3.4.2 to not understand get_custom_field? I feel like I
   have tried this and gotten an error that get_custom_field does not exist.
 *  [pzula](https://wordpress.org/support/users/pzula/)
 * (@pzula)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-custom-content-type-manager-using-shortcode-in-text-area/#post-2855501)
 * Is this because I need to define get_custom_field in my theme functions?
 *  Plugin Contributor [fireproofsocks](https://wordpress.org/support/users/fireproofsocks/)
 * (@fireproofsocks)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-custom-content-type-manager-using-shortcode-in-text-area/#post-2855502)
 * If you have installed CCTM and activated it, then that function gets defined.
   Its includes/functions.php file should be loaded during every page request. You
   can check whether it’s defined using function_exists: [http://php.net/manual/en/function.function-exists.php](http://php.net/manual/en/function.function-exists.php)
 * To debug your output, try printing the output of the function.

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘[Plugin: Custom Content Type Manager] Using shortcode in text area’ is
closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-content-type-manager_c9c790.
   svg)
 * [Custom Content Type Manager](https://wordpress.org/plugins/custom-content-type-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-content-type-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-content-type-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-content-type-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-content-type-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-content-type-manager/reviews/)

## Tags

 * [custom field](https://wordpress.org/support/topic-tag/custom-field/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)
 * [text-area](https://wordpress.org/support/topic-tag/text-area/)

 * 12 replies
 * 3 participants
 * Last reply from: [fireproofsocks](https://wordpress.org/support/users/fireproofsocks/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-custom-content-type-manager-using-shortcode-in-text-area/#post-2855502)
 * Status: resolved