vtrotot / annuaire-post-type
WordPress 主题自定义文章类型的目录
2.1
2022-03-01 08:32 UTC
Requires
- php: >=7
- javiereguiluz/easyslugger: ^1.0
- symfony/http-foundation: ^5.3
- timber/timber: ^1.18
README
AnnuairePostType 是一个允许向 WordPress 主题添加自定义文章类型 vt_annuaire 的包。
此自定义文章类型添加了四个元数据:负责人、地址、电话号码和电子邮件。
VincentTrotot\AnnuairePostType 类配置自定义文章类型,而 VincentTrotot\Annuaire 类是 Post 的包装器(该类继承自 Timber\TimberPost 类)。
安装
composer require vtrotot/annuaire-post-type
使用
您的主题必须实例化 AnnuairePostType 类
new VincentTrotot\Annuaire\AnnuairePostType();
然后您可以获取一个目录类型的文章
$post = new VincentTrotot\Annuaire\Annuaire();
或使用
$args = [ 'post_type' => 'vt_annuaire', ... ]; $posts = new Timber\TimberRequest($args, VincentTrotot\Annuaire\Annuaire::class);