【问题标题】:How to Format Bulleted Lists with Long FormText for Wordpress如何为 Wordpress 格式化带有 Long FormText 的项目符号列表
【发布时间】:2021-04-13 23:08:57
【问题描述】:

我在 Wordpress 中遇到了一系列带有长格式内容的项目符号列表的格式问题。

这是我的代码示例:

<ol>
<li><strong>Example Header 1</strong>
<p>Example paragraph 1.</p>
<p>Example paragraph 2</p>
<p>Example paragraph 3:</p>
<ul>
<li><strong>Example Subheader 1</strong><br />
Example bullet text 1</li>
<li><strong>Example Subheader 2</strong><br />
Example bullet text 2</li>
<li><strong>Example Subheader 3</strong><br />
Example bullet text 3.</li>
</ul>
</li>
<p>Example paragraph at the end of the list</p>
<li><strong>Example Header 2</strong>
<p>Example paragraph 4</p>
</li>
</ul>

我看到的最常见的问题:

  1. Wordpress(Gutenberg 和经典编辑器)正在剥离示例段落 1 和 4 周围的 p 标签,然后在该内容之后添加一个没有文本的空 p 标签。然后它将在示例第 2 段和第 3 段周围留下相同的 p 标签。

  2. 我的嵌入式无序列表将被视为嵌入式有序列表

  3. 对于示例标题 2,有序列表将从 #1 重新开始,而我希望它是列表项 #2。

我的高级目标是我希望所有内容在其标题和副标题下方一致对齐,具有一致和标准的换行符大小,并且有序列表中的行项目具有正确的编号。

我应该如何构建我的代码(或 Wordpress)来解决我遇到的问题并实现我想要的目标。

提前致谢!

【问题讨论】:

    标签: html wordpress formatting html-lists


    【解决方案1】:

    我假设你想要这样的东西:

    <ol>
      <li><strong>Example Header 1</strong>
        <p>Example paragraph 1.</p>
        <p>Example paragraph 2</p>
        <p>Example paragraph 3:</p>
        <ul>
          <li><strong>Example Subheader 1</strong><br /> Example bullet text 1</li>
          <li><strong>Example Subheader 2</strong><br /> Example bullet text 2</li>
          <li><strong>Example Subheader 3</strong><br /> Example bullet text 3.</li>
        </ul>
      </li>
     </ol>
      <p>Example paragraph at the end of the list</p>
      <li><strong>Example Header 2</strong>
        <p>Example paragraph 4</p>
      </li>

    【讨论】:

    • 使用该代码,Wordpress 将去除示例一周围的 p 标签,然后在该行之后添加一个空的 p 标签。我不知道它为什么这样做。导致我需要更改的代码是否存在问题?
    • 您在哪里使用 wordpress 中的代码?在帖子或页面中?或在侧边栏或主题中的某处(自定义页面/内容)?
    猜你喜欢
    • 2021-03-29
    • 1970-01-01
    • 1970-01-01
    • 2020-01-24
    • 1970-01-01
    • 2017-12-11
    • 2014-08-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多