Hi everyone,
I'm looking for a bit of help with my wpForo forum. I'm using the Simplified layout.
On the homepage, there is 4 forums with 3 of them having sub-forums. I have attached a screenshot.
Is there a way I can get it so those 3 forums show the total of topics and posts by counting their sub-forums too?
I have tried editing forum.php to include this code:
<?php $counts = wpforo_forum($cat['forumid'], 'counts'); ?> <?php echo wpforo_print_number($counts['topics']) ?>
in replacing of this code:
<?php echo wpforo_print_number($forum['topics']) ?>
But this changed the topic count to be the same on each forum :/
I hope this makes sense and I look forward to a reply 🙂
Thanks.
Hi @dannymh2x
you can display the counts separately in the Cat header
example
add this code in forum.php (layout 2)
<div class="wpf-cat-count"><?php $counts = wpforo_forum($cat['forumid'], 'counts'); ?><span class="wpf-topic-count" wpf-tooltip="<?php echo wpforo_print_number($counts['topics']) ?> Topics" wpf-tooltip-position="top" wpf-tooltip-size="medium"><i class="fas fa-layer-group"></i><?php echo wpforo_print_number($counts['topics']) ?></span> <span class="wpf-post-count" wpf-tooltip="<?php echo wpforo_print_number($counts['posts']) ?> Posts " wpf-tooltip-position="top" wpf-tooltip-size="medium"><i class="fas fa-list"></i><?php echo wpforo_print_number($counts['posts']) ?></span></div>
directly after
<div class="wpfl-2 wpforo-section">
and use this CSS code (example)
#wpforo #wpforo-wrap .wpf-cat-count { top: 50px; position: relative; padding: 5px 10px !important; font-size: 16px !important; margin-left: 20px !important; background: #fff; width: fit-content; border-radius: 5px; } #wpforo #wpforo-wrap .wpf-cat-count i { margin-right: 5px } #wpforo #wpforo-wrap .wpf-topic-count { margin-right: 10px !important; }
looks like this (attachment) or in my forum 😉Â
Hi @dannymh2x ,
We apologize for any inconvenience. We have fixed the statistics display part in the Simplified Layout. Please stay updated with wpForo's new releases, and you will receive the fixed version in the next release.