felixarntz / schema-breadcrumbs-for-wordpress-seo
此包已被废弃且不再维护。未建议替代包。
此类修改了Yoast的WordPress SEO插件,使其使用有效的Schema.org标记来代替RDFa作为面包屑。
1.3.1
2015-03-12 09:29 UTC
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2020-01-20 04:09:19 UTC
README
使用此类,WordPress SEO面包屑将使用有效的Schema.org标记。
如果当前WordPress安装中没有激活Yoast的WordPress SEO插件,此类将没有任何功能。此外,必须在插件设置中启用面包屑。
但是,添加此类不会破坏任何东西,因为所有更改都是通过WordPress SEO插件中的过滤器实现的。此类使用的过滤器包括
- 'wpseo_breadcrumb_single_link'
- 'wpseo_breadcrumb_output'
类的使用
从版本1.2.0开始,该类使用单例模式,因此只能实例化一次。只需将类文件包含到您的主题或插件中即可。然后您可以启用它,例如
function yourtheme_instantiate_class() { // only instantiate the class if Yoast breadcrumbs are used if( function_exists( 'yoast_breadcrumb' ) ) { Schema_Breadcrumbs::instance(); } } add_action( 'after_setup_theme', 'yourtheme_instantiate_class' );
您不需要做任何事情,只需要实例化类,它就会自行工作。
附加信息
阅读这篇简短的文章,了解更多关于此类的内容
查看GitHub上的WordPress SEO插件存储库
了解更多关于Schema.org标记的信息
该项目现在已在Packagist上,可以使用Composer来要求它