WordPress.org

Ready to get started?Download WordPress

Forums

Hide categories that contains less than X posts? (3 posts)

  1. robot11
    Member
    Posted 6 years ago #

    Is it possible to hide categories that contains less that X posts with WP options or if there are any plugins exist?

  2. robot11
    Member
    Posted 6 years ago #

    maybe is it possible not to show categories on posts pages? only at index?

    please help

  3. MichaelH
    Member
    Posted 6 years ago #

    This lists categories with over 7 posts:

    <?php
    $min_post_cats = $wpdb->get_col("SELECT term_id FROM $wpdb->term_taxonomy WHERE taxonomy = 'category' AND count > 7");
    $cats = implode(",", $min_post_cats);
    echo 'cats ' . $cats;
    $wlc_param_list='orderby=name&show_count=1&title_li=&include=' . $cats;
    wp_list_categories($wlc_param_list);
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic