• Resolved JackDavis

    (@jackdavis-1)


    Hi, this is my footer. There is parade of categories with most articles in. I need to exclude here categories with description that starts with “XXX”.
    So If some categories have description that starts with “XXX”, it may don´t show here.

    Is it possible please? Im newbie in PHP so I dont know if can I declare category discreption here.

    <?php global $teo_options;?>
    <footer role="contentinfo">
    
    <?php if(isset($teo_options['enable_popular_companies']) && $teo_options['enable_popular_companies'] == 1) { ?>
            <div class="stripe-regular">
                <div class="row">
                    <div class="column">
                        <h2><?php _e('Name', 'Couponize');?></h2>
                    </div>
                </div>
                <div class="row collapse">
                    <div class="column">
                        <div class="popular-companies flexslider">
                            <ul class="rr slides">
                                <?php
                                $args['hide_empty'] = 1;
                                $args['orderby'] = 'count';
                                $args['order'] = 'desc';
                                if(isset($teo_options['blog_category']) && $teo_options['blog_category'] != '')
                                    $args['exclude'] = implode(",", $teo_options['blog_category']);
                                $categories = get_categories($args);
                                foreach($categories as $category) {
                                    $image = get_option('taxonomy_' . $category->cat_ID);
                                    $image = $image['custom_term_meta'];
                                ?>
                                    <li>
                                        <a href="<?php echo get_category_link( $category->term_id );?>" class="wrapper-5 small">
                                            <img src="<?php echo aq_resize($image, 130, 130, true); ?>" alt="<?php echo $category->name;?> coupons">
                                        </a>
                                    </li>
                                <?php } ?>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        <?php } ?>

The topic ‘PHP – exclude by category description’ is closed to new replies.