I'm using a custom field plugin called Advanced Custom Fields to create custom fields, but i don't think that's what's causing the problem.

When i fetch the custom fields from a template using get_post_custom(), the

tags in the field is removed. If i view the source, it's written out like a big chunk of text but with "normal" line breaks, but that's not visible unless you view the source ofc.

How do fetch the custom fields and keep the

tags? I tried adding a tag around some text and that went fine, no issues displaying it. It's just

tags, grr.

Any ideas?


Advanced custom fields plugin has it's own set of functions to use, use them instead. Also text fields there have an option of weather to save HTML or pure text


They also have nice examples if you go to the documentation of the particular field type

  • That's fancy, didn't know! get_field() and the_field() both seem to work, thanks Mridul! – qwerty Oct 17 '12 at 11:15

@qwerty, I was having a similar issue and I was able to use http://codex.wordpress.org/Function_Reference/wpautop

Some more info on this thread: get_post_custom stripping styling issue

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.