• Resolved mfwebmaster

    (@mfwebmaster)


    Is it possible to use this plugin 2 counts the terms of a custom taxonomy made by the group. could you please advise on a way to do this.

    Below you will find a code I used to count the custom terms per taxonomy but I would like to do this 4 the group.

    <?php
    $current_user = wp_get_current_user();
    ?>

    <div class=”row”>
    <div class=”col-md text-center bg-success”>
    All
    <?php
    $args = array(
    ‘post_type’ => ‘taxonomys’,
    ‘post_status’ => ‘published’,
    ‘taxonomy’ => ‘taxonomy-type’,
    ‘term’ => ‘All’,
    ‘numberposts’ => -1,
    ‘author’ => $current_user->ID,
    );
    $num_1 = count( get_posts( $args ) );
    $sum_total = $num_1 / $num_1 * 100;
    ?>
    <h2 class=”align-middle”>
    <?php echo $num_1 ;?><br />
    100 %<br />
    </h2>
    </div>
    <div class=”col-md text-center bg-primary”>
    New
    <?php
    $args = array(
    ‘post_type’ => ‘taxonomys’,
    ‘post_status’ => ‘published’,
    ‘taxonomy’ => ‘taxonomy-type’,
    ‘term’ => ‘New’,
    ‘numberposts’ => -1,
    ‘author’ => $current_user->ID,
    );
    $num_2 = count( get_posts( $args ) );
    $sum_total_2 = $num_2 / $num_1 * 100;
    ?>
    <h2>
    <?php echo $num_2 ;?><br />
    <?php echo number_format((float)$sum_total_2, 2, ‘.’, ”);?> % <br />
    </h2>
    </div>
    <div class=”col-md text-center bg-danger”>
    Progress
    <?php
    $args = array(
    ‘post_type’ => ‘taxonomys’,
    ‘post_status’ => ‘published’,
    ‘taxonomy’ => ‘taxonomy-type’,
    ‘term’ => ‘Progress’,
    ‘numberposts’ => -1,
    ‘author’ => $current_user->ID,
    );
    $num_3 = count( get_posts( $args ) );
    $sum_total_3 = $num_3 / $num_1 * 100;
    ?>
    <h2>
    <?php echo $num_3 ;?><br />
    <?php echo number_format((float)$sum_total_3, 2, ‘.’, ”);?> % <br />
    </h2>
    </div>
    <div class=”col-md text-center bg-warning”>
    Completed
    <?php
    $args = array(
    ‘post_type’ => ‘taxonomys’,
    ‘post_status’ => ‘published’,
    ‘taxonomy’ => ‘taxonomy-type’,
    ‘term’ => ‘Completed’,
    ‘numberposts’ => -1,
    ‘author’ => $current_user->ID,
    );
    $num_4 = count( get_posts( $args ) );
    $sum_total_4 = $num_4 / $num_1 * 100;
    ?>
    <h2>
    <?php echo $num_4 ;?><br />
    <?php echo number_format((float)$sum_total_4, 2, ‘.’, ”);?> % <br />
    </h2>
    </div>
    </div>

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘use the groups plugin 2 counts a custom taxonomies terms per group’ is closed to new replies.