my site looks like:
Page-1 (page.php
)
... Subpage-1 (custom-collection.php
; Custom Post Type)
...... Filtering Output-Post (custom-collection-single.php
)
When I open the filtering output-post by using /%postname%
for permalinks I get 404 error page.
Some code:
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 (loop-single-empty.php)
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<?php endwhile; ?>
I try to added this to my functions.php
add_action('admin_init', 'flush_rewrite_rules');
When I use standard permalinks everything works fine for me.
.htaccess: <IfModule mod_rewrite.c> ...
is active
Thanks for your help.
Ogni