This could be really simple but:
I have a custom field as a textfield with tinyMCE.
If I attach an image to the custom field the image shows up fine but the caption is not processed on the front end. It literally is outputted as [caption id="attachment_646" align="alignnone" width="225" caption="caption information"]: ...image...[/caption]
How do I get around this? Do I need to run content through a function to get it outputting properly first?
[Image Column]
type = textarea
cols = 36
rows = 10
tinyMCE = true
mediaButton = true
class= imagecol
output = true
Thanks
kandi_nyc
Member
Posted 2 years ago #
have you been able to find a solution for this? i'm having the same issue.
thanks!
kandi_nyc
Member
Posted 2 years ago #
can anyone provide assistance?
Hi Kandi,
Yes I got is sorted:
<?php
$unprocessedfield = get_post_meta($post->ID, 'nameofyourcustomfield',true));
$processedfield = apply_filters('the_content', $unprocessedfield );
echo $processedfield;
?>
manntis
Member
Posted 2 years ago #
I don't get how that fixed it.
When I use the method above, I still get the close tag for caption showing
[/caption]then article text begins
morethanever
Member
Posted 2 years ago #
Manntis,
proximity2008's solution didn't work for me either,
while this, which seems identical, did:
echo apply_filters('the_content', get_post_meta($post->ID, 'nameofyourcustomfield', true));
i don't know if it's a PHP4 thing or maybe the way strings are stored/displayed. Hope that helps.
zandercent
Member
Posted 2 years ago #
just thought I'd point out that there's an extra ')' in here - it should be
<?php
$unprocessedfield = get_post_meta($post->ID, 'nameofyourcustomfield',true);
$processedfield = apply_filters('the_content', $unprocessedfield );
echo $processedfield;
?>