我正在努力解决这个问题:
我创建了新的自定义帖子类型。当我创建一篇文章并为其分配一个类别(比如类别1)时,当我尝试访问类别1 url时,会出现“出现错误”
我试着根据Michal Mau邮报解决这个问题(How to display regular posts & custom post types that fall under a category using just the generic category template?).
添加Michal Mau建议后,我编辑的代码如下所示:
<?php if (have_posts()) :
global $wp_query;
$args = array_merge( $wp_query->query, array( \'post_type\' => \'any\' ) );
query_posts( $args );
while (have_posts()) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(\'post-holder\'); ?>>
<?php if(has_post_thumbnail()) {
echo \'<figure class="featured-thumbnail"><span class="img-wrap"><a href="\'; the_permalink(); echo \'">\';
echo the_post_thumbnail();
echo \'</a></span></figure>\';
}
?>
The problem wasn\'t solved. I don\'t know if there is a mistake pasting the code or any other mistake.