我的网站看起来像:
Page-1 (page.php
)
。。。Subpage-1 (custom-collection.php
; 自定义帖子类型)
。。。。。。Filtering Output-Post (custom-collection-single.php
)
当我使用打开过滤输出帖子时/%postname%
对于permalinks,我得到404错误页。
一些代码:
custom-collection.php
<?php $args = array( \'post_type\' => \'weine\', \'posts_per_page\' => -1, \'orderby\' => \'rand\' );
// ============================= WHITEWINE ===============================
if( is_page(\'147\') ) {
$args = array(
\'tax_query\' => array(
array(
\'taxonomy\' => \'sorte\',
\'field\' => \'slug\',
\'terms\' => array(\'weisswein\')
)
)
);
}
// ============================= REDWINE ===============================
。。。// =========================== All WINES ==================================
else {}
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post(); ?>
<a class="item" rel="wine" href="<?php the_permalink(); ?>" >
<?php the_post_thumbnail(\'wine-flow\', array(\'class\' => \'content\')); ?>
<!-- <div class="label">Slider Label</div> -->
</a>
<?php endwhile; ?>
custom-collection-single.php <?php get_template_part( \'loop\', \'single-empty\' ); ?>
<?php
echo \'<div class="wein-bottle-thumb">\';
the_post_thumbnail(\'wine-flow\');
echo \'...\';
?>
The Loop (循环single empty.php)<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<?php endwhile; ?>
一<?php get_template_part( \'loop\', \'single-empty\' ); ?> <?php echo \'<div class="wein-bottle-thumb">\'; the_post_thumbnail(\'wine-flow\'); echo \'...\'; ?>
当我使用标准permalinks时,一切都很好
。htaccess:<IfModule mod_rewrite.c> ...
处于活动状态谢谢你的帮助
奥尼