【问题标题】:why post_class() function apply css classes to all other files in Wordpress?为什么 post_class() 函数将 css 类应用于 Wordpress 中的所有其他文件?
【发布时间】:2021-02-26 17:08:01
【问题描述】:

我使用 post_class() 函数来添加自定义的 CSS 类,例如 width 和 display 属性。但它适用于所有其他文件,如关于页面、联系页面。我尝试使用 WordPress 类而不是使用 HTML 的类属性。 我提到了wordpress.org。 我认为 post_class 可以用于 WordPress 预定义的类,也可以用于添加自定义类。 这是一个正确或错误的方法。如果有人知道,请建议在哪里使用 post_class()?并且可以使用 post_class() 添加自定义类。

【问题讨论】:

    标签: php wordpress function wordpress-theming custom-wordpress-pages


    【解决方案1】:

    这是正确的方法。 你可以在post_class()函数中添加你自己的类

    【讨论】:

      猜你喜欢
      • 2016-12-24
      • 2011-04-24
      • 1970-01-01
      • 1970-01-01
      • 2014-08-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多