Here is my code :
<?php get_header();?>
<?php display_breadcrumbs(); ?>
<article>
<?php if ( is_category() ){
echo '<h1>' . single_cat_title('', false) . '</h1>';
echo category_description( );
}
else
echo '<h1><i class="fa fa-tag"></i> ' . single_tag_title( '', false ) . '</h1>';
?>
<div class="loop center">
<?php
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$args = array(
'post_type' => 'post', //Specyfying post type
'paged' => $paged //For pagination
);
$loop = new WP_Query( $args );
if ( have_posts() ) :
while ( $loop->have_posts() ) : $loop->the_post();
get_template_part('content');
endwhile;
get_template_part('pagination');
endif; ?>
</div>
</article>
</section>
<?php
if( is_category() ){?>
<div id="dls" class="row">
<div class="center">
<?php
// Dossier de presse
$dossier = get_post_meta($post->ID, 'dossier', true);
if( !empty( $dossier ) )
$dossier=" pdf="" . $dossier . '"';
echo do_shortcode( '[dossier' . $dossier . ']' );
?>
</div>
</div>
<?php
echo '
<div id="form" class="row metaform">
<h2 class="center">Vous souhaitez réaliser un projet similaire ?</h2>';
// echo '<p>/projets/' . get_the_category()[0]->slug . '</p>';
contact_form( '/projets/' . get_the_category()[0]->slug );
echo '</div>';
}
?>
<?php get_footer(); ?>
And the pagination.php file :
<nav class="pagination group">
<?php if ( function_exists('wp_pagenavi') ): ?>
<?php wp_pagenavi(); ?>
<?php else: ?>
<ul class="group">
<li class="prev left"><?php previous_posts_link(); ?></li>
<li class="next right"><?php next_posts_link(); ?></li>
</ul>
<?php endif; ?>
</nav>
This link does not work :
riehling.mrcoolblog. com/projets/concevoir/
But this one does :
riehling.mrcoolblog. com/concevoir/page/2/
So does this one :
riehling.mrcoolblog. com/concevoir/
I guess there is something wrong with my permalink structure, but I don’t know what it is…
In Yoast, I removed the category base and I added it in the “permalink” settings (as described in the first post), maybe I should remove that and use another way ? What is the clean way to put ‘/projets/’ in front of any archive/post ?