php - 帖子格式视频的存档页面
问题描述
我创建了一个视频帖子格式,还创建了一个single-video.php
显示单个视频帖子的格式。添加了以下代码以functions.php
包含单个视频页面模板。
function templateForSingleVideo( $template ) {
if ( is_single() && has_post_format() ) {
$post_format_template = locate_template( 'single-' . get_post_format() . '.php' );
if ( $post_format_template ) {
$template = $post_format_template;
}
}
return $template;
}
add_filter( 'template_include', 'templateForSingleVideo' );
它工作得很好。但现在我想要一个页面,其中将显示所有类别的帖子(帖子格式=视频)。只想显示所有视频..
对不起,我的英语不好。
谢谢
解决方案
推荐阅读
- c# - 如何使用“upn”/“unique_name”(用户的电子邮件 ID)作为声明的一部分为我的 API 集成测试用例创建授权令牌
- android - CollapsingToolbarLayout 折叠时显示工具栏图标
- java - 使用反射根据接收到的参数访问属性 - Java
- c# - 从非根目录加载程序集
- java - 如何将文件从服务器(Spring 框架)上传到其他服务器(例如:112.12.15.2)
- c# - 序列的逆补
- reactjs - 反应原生如何在 tabBarOnPress 上重新渲染刷新屏幕
- matlab - 在 Matlab 的数据数组中添加缺失/额外的值
- angular - 无法通过其中一种方法访问 authService 中的公共属性
- dart - Bloc 无法在对话框中返回数据