Viewing 15 replies - 1 through 15 (of 88 total)
  • There’s only a few 1,000 ways to do that.

    Firstly, where are you getting the nubmers from? Are they members on your site? Some other site?

    Secondly, are the members segmented or grouped so that you can get the different group totals?

    There’s far too many ways that this can be done, and everything will depend on the et up of your website, so we’re going to need a whole lot more info before we could give any sort of real “solution” for this.

    Oh, and by the way… the forum volunteers here (myself included) don’t just write code blocks for free. ?? To get a good response the best thing to do is try it for yourself, and them come back here if something doesn’t work, and let us know what errors your facing from the code that you’ve written. Do that and we’ll be able to give you a whole lot more help.

    Thread Starter mndo123

    (@mndo123)

    these example number but i need it to be live statistics with my site’s activity
    real results
    thanks

    OK, so go back and re-read my questions above. Anyone that’s doing this would need to know everything that I’ve said above, and probably more.

    Thread Starter mndo123

    (@mndo123)

    segmented if that what do you mean ?

    In that example, the numbers are segmented into:

    • Visitors
    • Members
    • Grapic Designers
    • Sold Items

    Now, things ike “Visitors”, “Members” and “Sold Items” may not need any sort of grouping, having a category of ‘Graphic Designers” probably will.

    Like I said, there’s only a few 1,000 ways to do this. There’s no quick-and-easy way to do it, and you are going to have to do at least some of the hard work yourself.

    Thread Starter mndo123

    (@mndo123)

    so can u please tell me how i start with
    at least what the ??????.php file to work with

    Which PHP file? That could have a few options.

    If it was me I’d create a new plugin for myself. If that’s too much then I’d create a child theme (so the changes don’t get over-written) and add a new functions.php file in there that I can add code into.

    Thread Starter mndo123

    (@mndo123)

    ok good idea thanks

    Hi mndo123,
    what exactly you want to display?

    like catacaustic says, is it Total visitor, Total member, etc?
    You need to explain what you need to display.

    Thread Starter mndo123

    (@mndo123)

    please look to the pic

    it live activity

    Visitors = hits
    Members = registered users
    Grapic Designers = woocommerce all items
    Sold Items = woocommerce all sold items

    You need to customize your themes then.
    You can place the code inside page.php and single.php (depend where you need to display).

    It can be done by this.

    1. get Visitors hit:
    use plugin: https://www.ads-software.com/plugins/wp-useronline/
    (please read plugin documentation how to display by custom code in themes)

    2. Total registered user:
    use this php code:

    <?php
    global $wpdb;
    $user_count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->users" );
    echo "<p>User count is {$user_count}</p>";
    ?>

    3. Woocommerce total item:
    use this php code:

    <?php
    $args = array( 'post_type' => 'product', 'post_status' => 'publish', 'posts_per_page' => -1 );
    $products = new WP_Query( $args );
    echo $products->found_posts . 'total';
    ?>

    4. Total sold items:
    use plugin: https://www.ads-software.com/plugins/woocommerce-total-sales-shortcode/
    (please read plugin documentation how to display by custom code in themes)

    That’s my clue. and it can be done by that.
    Maybe catacaustic have other solution for that by writing custom plugin.

    Good luck.

    Thread Starter mndo123

    (@mndo123)

    really good one thank you very much

    Thread Starter mndo123

    (@mndo123)

    hi i tried put it in many thing
    page,style.css
    .header.css
    but not work
    what php file i need to use ?

    and online user not use shortcode
    can u help ?

    Thread Starter mndo123

    (@mndo123)

    and how can i add icon with each one ?

    Thread Starter mndo123

    (@mndo123)

    any bode here ?

Viewing 15 replies - 1 through 15 (of 88 total)
  • The topic ‘what is the code for that ?’ is closed to new replies.