vtrotot/geko-post-type

Geko WordPress 主题自定义文章类型

1.0.4 2021-09-01 06:35 UTC

This package is auto-updated.

Last update: 2024-09-29 06:08:56 UTC


README

GekoPostType 是一个允许向 WordPress 主题添加自定义文章类型 vt_geko 的包。
此自定义文章类型添加了两个元数据:PDF 文件的名称和 URL。

VincentTrotot\Geko\GekoPostType 类配置自定义文章类型,而 VincentTrotot\Geko\Geko 类则是 Post 的包装器(该类继承自 Timber\TimberPost 类)。

安装

composer require vtrotot/Geko-post-type

使用

您的主题必须实例化 GekoPostType

new VincentTrotot\Geko\GekoPostType();

然后您可以获取 Geko 类型的文章

$post = new VincentTrotot\Geko\Geko();

或者获取多个文章

$args = [
    'post_type' => 'vt_geko',
    ...
];
$posts = new Timber\TimberRequest($args, VincentTrotot\Geko\Geko::class);