How do I make Mixitup work with WordPress?

Some context:
I was searching hiw and low for a way to integrate Mixitup with WordPress categories. Most people recommends this tutorial, but I couldn’t make it work, and I have find more people not able to make that tutorial work that people actually achieving it, maybe because it’s in French.

I contacted Mixitup coder and posted at their forum, but nothing, although there’s a very broad and general answer here

Read More

Bottom line is I was unable to make it work with WordPress, although I had no issues with pure HTML sites, so my question is if anyone around here achieved to make this work with WP categories, and if so, which code do I need to use for this?

Related posts

Leave a Reply

1 comment

  1. OK, since you didn’t provide any code, I’ll post the way I’ve done for a page I built. It’s in Spanish, so you might not see it at first sight, but it’s more or less the default MIxitup code using Mixitup2, only that applied to WordPress. Please lmk if you have any questions.

    <div class="col-lg-8 col-md-8 col-sm-12">
        <div class="col-sm-12 botonera">
            <button class="sort" data-sort="my-order:asc">Orden Ascendente</button>
            <button class="sort" data-sort="my-order:desc">Orden Descendente</button>
        </div>
        <div class="clearfix"></div>
        <ul id="filters">
            <li class="filter col-sm-6 col-md-3" data-filter="all">Todas las Provincias</li>
            <?php $args=a rray( 'child_of'=>'5', 'hide_empty' => 0); // List all categories, we want to exclude our first category // Change the arguments as you like $categories = get_categories($args); foreach ($categories as $category) { echo '
            <li class="filter col-sm-6 col-md-3" data-filter=".'. $category->slug .'">'. $category->name .'</li>'; } ?></ul>
        <div class="clearfix"></div>
        <ul id="gallery">
            <?php if (have_posts()) : ?>
            <?php global $post; $my_query=n ew WP_Query( 'showposts=-1&category_name=provincias'); while ($my_query->have_posts()) : $my_query->the_post(); $args = array('child_of' => '5', 'hide_empty' => 0); $categories = get_categories($args); $post_cat = get_the_category($post_id); $post_title = get_the_title($post_id); $cat_name = $post_cat[0]->cat_name; $cat_slug = $post_cat[0]->slug; ?>
            <?php echo '<li class="col-sm-6 col-md-3 mix '.$cat_slug. '"  data-my-order="'.$post_title. '">' ?>
                <h5><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </h5>
    
            </li>
            <?php endwhile;?>
        </ul>
        <?php endif;?>
    

    Just so you understand: in this code I had to list all cities (subcategories) that were included inside a “Province” category (category 5) . This way, I can use Mixitup to filter those results and show only the cities in some province, or even any given province.

    Anyways, check it out and modify as you need