문제

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