Support Forum
hey Meztli,
I've not played around with widgets too much so this seemed like a good opportunity to me!
It was actually pretty straight forward to display these two stats items in a widget. Firstly you will want to use the 'Text' widget, put it where you want it to display and open it to edit.
Then open your themes spFoot.php and find the two functions you want to display - In this case 'sp_ForumStats' and 'sp_MembershipStats'. Select each function in their entirety and copy them into the text widget, wrapping them in PHP tags:
<?php sp_ForumStats('tagClass=spRight', __sp('Forum Stats: '), __sp('Groups: '), __sp('Forums: '), __sp('Topics: '), __sp('Posts: ')); sp_MembershipStats('tagClass=spRight', __sp('Member Stats: '), __sp('Members: %COUNT%'), __sp('Guest Posters: %COUNT%'), __sp('Moderators: %COUNT%'), __sp('Admins: %COUNT%')); ?>
That's pretty much it to get the stats to display - you have the option then of styling. All the elements of the widget are made up of the same classes as are used on the forum, but because they are outside of the forum they get their style from the WP theme so you will want to make any style changes there. You can target them using the .textwidget class, so for example:
.textwidget .spForumStatsTitle { font-weight: bold; }
- Should work. You might need to have a play around with that part!
Hope that helps!
Thank you guys, terrific!
I used the php-exec plugin on my old website and we had some issues with it.
However since we are now using the Genesis framework (new website since january), it migth work better, but i have to try it out on our test site before going live with it at http://friskyttarna.eu
1 Guest(s)