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

When creating a blog post through the WYSIWYG editor, text is not being wrapped in <p> tags correctly when startin

programmeradmin2浏览0评论

When creating a new blog post, and the first item is a link follewed by text like this:

<a>Some link</a> some text

When this is rendered into HTML The

tags get placed at the end of the text like this:

<a>Some link</a> some text<p></p>

If there is any text before the link at the beginning then

tags are wrapped correctly.

I have gone into wp-includes/formatting.php and am not able to find source of this problem...

Any insight or suggestions would be greatly appreciated. Thanks.

When creating a new blog post, and the first item is a link follewed by text like this:

<a>Some link</a> some text

When this is rendered into HTML The

tags get placed at the end of the text like this:

<a>Some link</a> some text<p></p>

If there is any text before the link at the beginning then

tags are wrapped correctly.

I have gone into wp-includes/formatting.php and am not able to find source of this problem...

Any insight or suggestions would be greatly appreciated. Thanks.

Share Improve this question asked Sep 12, 2019 at 9:31 JoshJosh 32 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

May this will helpful for you
1) There will be no p tag will wrap while starting with anchor tag. The editor will takes a each paragraph in a paragraph tag.(Whether it may any tag, the editor will all the html content inside of p tag)
2) If you are using wordpress default post editor means just print it by using the_content() or get_the_content($post_id) .
3) If you are using Custom Field (ACF) means use apply_filters().

<?php echo apply_filters('the_content', 'your_field_name');?>

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论