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

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

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');?>

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745164626a4614563.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信