سؤال

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.""; }?>
هل كانت مفيدة؟

المحلول

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); } ?>
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top