【问题标题】:Custom post types support in WordLiftWordLift 中的自定义帖子类型支持
【发布时间】:2018-08-07 06:07:18
【问题描述】:

我正在为 WordPress 使用 WordLift 插件,我想为我的网站中的其他自定义帖子类型添加对语义 SEO 的支持。有没有办法做到这一点?

【问题讨论】:

    标签: wordpress semantics semantic-markup wordlift


    【解决方案1】:

    是的,您可以使用一个过滤器来添加自定义帖子类型:wl_valid_entity_post_types

    过滤器采用支持的帖子类型(默认为postpageentity)的数组。您可以将自定义帖子类型添加到数组并返回它,例如:

    add_filter('wl_valid_entity_post_types', function ($post_types) { $post_types[] = 'gallery'; return $post_types; });

    供参考 GitHub 上的add a WordPress filter to allow customers to extend the post types that can be turned into entities

    【讨论】:

      猜你喜欢
      • 2019-03-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多