ADD DYNAMIC attribute for category to accordion

Ok, you were basically almost there, all you had to do was output the slug value in two places in the sprint(). Answer edited/added to: <ul class=”accordion”> <?php $categories = get_categories( array( ‘orderby’ => ‘name’, ‘order’ => ‘DESC’, ‘offset’ => 1 ) ); $cat_array = array(); foreach( $categories as $category ) { $category_link = sprintf( … Read more

Can’t display posts by filtering categories using isotope.js

Can you try: <?php if (have_posts()): ?> <?php while (have_posts()): the_post(); ?> <?php $categories = get_the_category(); $listCategories = []; foreach ($categories as $category) { $listCategories[] = $category->slug; } ?> <!– Isotope Grid-Item –> <div class=”col-md-3 col-sm-4 col-xs-12 isotope-grid-item <?php echo implode(‘ ‘, $listCategories); ?>” data-category=”<?php echo implode(‘,’, $listCategories); ?>”> <div class=”isotope-item”> <a href=”#”> <div class=”isotope-feature-image”><?php … Read more