最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

custom field - Line break description wordpress

programmeradmin1浏览0评论

Currently in Wordpress 5.1, I create custom fields including a description field using the text editor of worpress, however I encounter a problem no line break is made. Is there a function for the line break to work

Currently in Wordpress 5.1, I create custom fields including a description field using the text editor of worpress, however I encounter a problem no line break is made. Is there a function for the line break to work

Share Improve this question asked Apr 11, 2019 at 14:29 Jeanne ThibertJeanne Thibert 135 bronze badges 2
  • Are you using code to create the custom fields? If so, it would help to include it in your question. – WebElaine Commented Apr 11, 2019 at 14:36
  • Excuse me hastebin/mofivivexi.xml – Jeanne Thibert Commented Apr 11, 2019 at 14:41
Add a comment  | 

1 Answer 1

Reset to default 0

You should use the filter to show the description. Try to replace $your_description with the custom field value.

$content = apply_filters('the_content', $your_description);
echo !empty($your_description) ? $content : __('Nothing to show!', 'your_textdomain');
发布评论

评论列表(0)

  1. 暂无评论