Bonjour,
Ma configuration WP actuelle
– Version de WordPress : 4.5
– Version de PHP/MySQL : 5.5
– Thème utilisé : twentytwelve
– Extensions en place : beaucoup
– Nom de l’hebergeur : ovh
– Adresse du site :
Problème(s) rencontré(s) :
Bonjour, j’aimerais afficher seulement 5 articles, je ne voulais pas utiliser de modules pour plusieurs raisons ( j’aimerais développer mon thème seul etc).
Jusqu’ici niquel, or sur la page j’aimerais afficher seulement 5 articles, je ne vois pas comment implementer mon compteur ni ou …Merci de votre aide.
<?php if (have_posts()) : while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
<?php
$custom = get_post_custom($post->ID);
$testiname = $custom[« testimonial-name »][0];
$testiurl = $custom[« testimonial-url »][0];
?>
<article id="post-<?php the_ID(); ?> » class= »testimonial »>
<div class="post-content">
<?php the_content(); ?>
<span class="name-testi">
<span class="user"><?php echo $testiname; ?></span><br />
<a href="<?php echo $testiurl; ?> » rel= »nofollow »><?php echo $testiurl; ?></a>
</span>
</div>
</article>
<?php endwhile; else: ?>
<div class="no-results">
<p><strong>There has been an error.</strong></p>
<p>We apologize for any inconvenience, please <a href="<?php bloginfo('url'); ?>/ » title= »<?php bloginfo('description'); ?>« >return to the home page</a> or use the search form below.</p>
<?php get_search_form(); ?> <!-- outputs the default Wordpress search form-->
</div><!--noResults-->
<?php endif; ?>