I would like to be able to drag in a text element called Text Counters and this element will use datasets, sorting, limit and more and then functions like total, sum, median and more to just get sums and return that.
If I want to display how many clients we have I can just drag in this text elements, choose the dataset and choose function Count Records and it will return 34 and I can format that and place it anywhere. I can shoot it towards ecomm, collections, users and pages collections.
I made the WordPress Plugin WP Pro Counter and it does this and it is popular.
I opens a lot of door for dynamic data on backend admin parts and also frontend.
Hello Andreas I am going to help you create this feature
If you would like to get code examples and counter visit: javascript - Button click counter - Stack Overflow
This is a html code example of a click counter:
<?php $counterFile = 'counter.txt' ; // jQuery ajax request is sent here if ( isset($_GET['increase']) ) { if ( ( $counter = @file_get_contents($counterFile) ) === false ) die('Error : file counter does not exist') ; file_put_contents($counterFile,++$counter) ; echo $counter ; return false ; } if ( ! $counter = @file_get_contents($counterFile) ) { if ( ! $myfile = fopen($counterFile,'w') ) die('Unable to create counter file !!') ; chmod($counterFile,0644); file_put_contents($counterFile,0) ; } ?> <script type="text/javascript"> jQuery(document).on('click','a#download',function(){ jQuery('div#counter').html('Loading...') ; var ajax = jQuery.ajax({ method : 'get', url : '/test.php', // Link to this page data : { 'increase' : '1' } }) ; ajax.done(function(data){ jQuery('div#counter').html(data) ; }) ; ajax.fail(function(data){ alert('ajax fail : url of ajax request is not reachable') ; }) ; }) ; </script> <div id="counter"><?php echo $counter ; ?></div> <a href="<?php echo get_field("pdf"); ?>" id="download" onclick="window.open(this.href);return false;">Download btn</a>
Copy and paste this into the html container
Hope I could help!
Kevin 