简体   繁体   English

如何控制<p>在 Wordpress 中

[英]How to control <p> in Wordpress

I am trying to do something very simple in my post:我试图在我的帖子中做一些非常简单的事情:
图像示例

Instead of this, I am getting:而不是这个,我得到:
图像示例

That's because when I am doing it at the visual editor, it counts "Title" as a paragraph and the list is outside this paragraph.那是因为当我在可视化编辑器中执行此操作时,它将“标题”视为一个段落,而列表在此段落之外。

I didn't find a way to control the <p> tag at the text editor.我没有找到在文本编辑器中控制<p>标签的方法。 Also I tried to press shift + enter after the title but then I can't define the list.我也尝试在标题后按 shift + enter 但我无法定义列表。

How can I handle this situation?我该如何处理这种情况? preferable in the most generic way (for other posts to work like this too...)最好以最通用的方式(对于其他帖子也像这样工作......)

Thank you.谢谢你。

The WordPress "visual editor" [WYSIWYG] will often inject or modify HTML elements, that's just what it does. WordPress“可视化编辑器”[WYSIWYG] 经常会注入或修改 HTML 元素,这就是它的作用。 One approach would be to try to create the content using the other, HTML editor tab and see if you can get the result you want that way.一种方法是尝试使用另一个 HTML 编辑器选项卡创建内容,然后查看是否可以通过这种方式获得所需的结果。

Another approach would be to modify the styling of certain elements in the theme's style.css file [the more specific the better so as to not interfere with other styling].另一种方法是修改主题的 style.css 文件中某些元素的样式[越具体越好,以免干扰其他样式]。 It depends on your theme but you could try something like this:这取决于你的主题,但你可以尝试这样的事情:

div#primary main#main article div.entry-content p {
    margin-bottom: 1px;
    margin-top: 1px;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM