Feb 22, 2018 9:30 pm
I would like to be able to show the forum statistics on non-forum pages, and also possibly in a widget on a sidebar. Is this possible? If so how?
Thanks in advance.
9 Replies
Feb 23, 2018 5:47 am
ooooh that would be cool 🙂
Feb 24, 2018 3:11 pm
You should use this function in template files:
<?php $stat = WPF()->statistic(); ?>
The $stat is an array of all stat data.
<?php echo 'Forums: ' . $stat['forums']; ?>
<?php echo 'Topics: ' . $stat['topics']; ?>
<?php echo 'Posts: ' . $stat['posts']; ?>
<?php echo 'Members: ' . $stat['members']; ?>
<?php echo 'Online Users: ' . $stat['online_members_count']; ?>
<?php echo $stat['last_post_title']; ?>
<?php echo $stat['last_post_url']; ?>
Feb 27, 2018 11:50 am
And how would I make this show only on particular pages?
Feb 27, 2018 7:25 pm
You would need to create or edit a WordPress page template and use the code that Robert provided.
Page 1 / 2
Next