Question

I want allow paragraphs in post_meta of custom type. I think is with WPautopop but how use it in this code? Really thanks

<?php $metacontenido = get_post_meta($postid, 'ofertacontenido', true);
    if($metacontenido != $empty) { echo "".$metacontenido.""; }?>
Was it helpful?

Solution

The wpautop() function will automatically convert line endings to <p> tags. You can read more about it here.

<?php $metacontenido = get_post_meta($postid, 'ofertacontenido', true);
      if($metacontenido != $empty) { wpautop($metacontenido); } ?>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top