0

I have a column in my website's footer where I show the visitors of today, yesterday and all times which looks like this:

<p> Today's Views:   <span> <!--?php here comes the related php code ?--> </span></p><br><br>

<p>Yesterday's Views:   <span> <!--?php here comes the related php code ?--> </span></p><br><br>

<p>All times Views:   <span> <!--?php here comes the related php code ?--> </span></p><br><br>

For this reason I've already installed wp Statistics plugin and I want o use its functions. But when I try to use one of the functions below I get this error:

Fatal error: Call to undefined function wp_statistics_today() in /home/xxxx/public_html/wp-content/themes/xxx/footer.php on line 34

<?php echo wp_statistics_today(); ?>
<?php echo wp_statistics_yesterday(); ?>

But when I call <?php echo wp_statistics_useronline(); ?> I get the corrent result.

How can I fix this?

Please note that I'm talking about my whole website's view count; not a specific post or page.

2

Here is what you need to use for the expected result:

<p> Today's Views:   <span> <?php echo wp_statistics_visit('today'); ?>  </span></p><br><br>

<p>Yesterday's Views:   <span> <?php echo wp_statistics_visit('yesterday'); ?> </span></p><br><br>

<p>All times Views:   <span> <?php echo wp_statistics_visit('total'); ?> </span></p><br><br>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.