how to display count of total posts and for every category and having possibility to filter between dates and user


Hello i use simple plugin that count numbers of posts for every category and total but i was stuck in how to display count of posts between to dates and with authors.

<div class="wrap posts-and-users-stats">

    <nav class="nav-tab-wrapper">
        <?php echo "<h2> Nombres des articles </h2>" ?>


    $categories = get_categories( array(
    'orderby' => 'name',
    'order'   => 'ASC'
) );
        <table id="table-<?php echo esc_attr($taxonomy); ?>" class="wp-list-table widefat">
                <?php foreach ($categories as $category) { ?>
                        <td><?php echo esc_html($category->name ); ?></td>
                        <td class="number"><?php echo esc_html($category->count); ?></td>
                    <?php } ?>


this the code i used for filter

<form method="post">
            From : <input type="date" name="from">
            To : <input type="date" name="to">
            User :<?php wp_dropdown_users($args); ?>
            Catégories :<?php wp_dropdown_categories($args); ?>
            <input type="submit" name="submitbtn">
    $from = $_POST['from'];
    $to = $_POST['to'];
    $user = $_POST['user'];
    $category = $_POST['categories'];
    print "From" . $from . "n";
    print "To" . $to . "n";
    print "User" . $user . "n";
Hassani Mohamed 2 months 0 Answers 13 views 0

Leave an answer