Stores category posts in an array


I’m trying to get my posts from my category.php file.

The loop works fine, it’s showing my custom post types, but I’d like to store the posts from my category to reorder them in a certain way.

How do I do that ? Tried to use get_posts(), the it return the 3 first post of the ‘post’ post type.

    if (have_posts()) : ?>
        <section class="playlist_row row">
            <div class="col-12 owl-container" id="<?= "";?>">
                <div class="owl-carousel owl-theme">
                while (have_posts()) : the_post(); ?>
                        <?php get_template_part("template-parts/card/playlist", "card"); ?>
                <?php endwhile; ?>
    else: ?>
        <p>Aucun résultat.</p>

    <?php endif; ?>

lucrece 1 year 2021-09-25T06:22:32-05:00 0 Answers 0 views 0

Leave an answer