• Affichage varié selon les catégories dans un query_posts()

    <?php

    query_posts(‘cat=5,6,7&showposts=3’);

    if (have_posts()) : ?>

    <?php while (have_posts()) : the_post(); ?>

    <?php

    if ( in_category(‘formation1’) ) {

    include ‘form1.php’;

    } elseif ( in_category(‘formation2’) ) {

    include ‘form2.php’;

    } elseif ( in_category(‘formation3’) ) {

    include ‘form3.php’;

    } else {

    // Continue with normal Loop

    }

    ?>

    Read more »