Notifications
Clear all

wpForo 1.x.x make homepage show only resolved topics

10 Posts
4 Users
0 Likes
634 Views
netvilox
Posts: 64
Topic starter
(@netvilox)
Trusted Member
Joined: 3 years ago

please how do i make my homepage show only resolved topics only. users can as well click on the the other buttons like newest and unsolved and popular. but when my homepageis reloaded i want it to show the resolved topics as the default.

 

9 Replies
netvilox
Posts: 64
Topic starter
(@netvilox)
Trusted Member
Joined: 3 years ago

What about this please

Reply
5 Replies
Alvina
Moderator
(@alvina)
Joined: 3 years ago

Member
Posts: 1872

@netvilox,

I've just asked our developers and currently, I'm waiting for the response from them. I'll update the topic asap.

 

Reply
netvilox
(@netvilox)
Joined: 3 years ago

Trusted Member
Posts: 64

@alvina OK thanks s million times

 

Reply
Sofy
 Sofy
Admin
(@sofy)
Joined: 5 years ago

Support Team
Posts: 4057

@netvilox,

Below is provided a solution for Threaded layout:

1.Open the /wp-content/plugins/wpforo/wpf-themes/classic/layouts/4/forum.php file

2. Find the following code: 

<?php if( WPF()->forum->options['layout_threaded_filter_buttons'] ): ?>
<a class="wpf-threads-filter wpf-newest wpf-active" data-filter="newest" wpf-tooltip="<?php echo esc_attr(wpforo_phrase( 'Newest', false )) ?>" wpf-tooltip-position="top"><i class="fas fa-clock"></i></a>
<a class="wpf-threads-filter wpf-hottest" data-filter="hottest" wpf-tooltip="<?php echo esc_attr(wpforo_phrase( 'Popular', false )) ?>" wpf-tooltip-position="top"><i class="fab fa-hotjar"></i></a>
<a class="wpf-threads-filter wpf-solved" data-filter="solved" wpf-tooltip="<?php echo esc_attr(wpforo_phrase( 'Resolved', false )) ?>" wpf-tooltip-position="top"><i class="fas fa-check-circle"></i></a>
<a class="wpf-threads-filter wpf-unsolved" data-filter="unsolved" wpf-tooltip="<?php echo esc_attr(wpforo_phrase( 'Unsolved', false )) ?>" wpf-tooltip-position="top"><i class="fas fa-times-circle"></i></a>
<?php endif; ?>

3. replace with this one:

<?php if( WPF()->forum->options['layout_threaded_filter_buttons'] ): ?>
<a class="wpf-threads-filter wpf-solved wpf-active" data-filter="solved" wpf-tooltip="<?php echo esc_attr(wpforo_phrase( 'Resolved', false )) ?>" wpf-tooltip-position="top"><i class="fas fa-check-circle"></i></a>
<a class="wpf-threads-filter wpf-newest " data-filter="newest" wpf-tooltip="<?php echo esc_attr(wpforo_phrase( 'Newest', false )) ?>" wpf-tooltip-position="top"><i class="fas fa-clock"></i></a>
<a class="wpf-threads-filter wpf-hottest" data-filter="hottest" wpf-tooltip="<?php echo esc_attr(wpforo_phrase( 'Popular', false )) ?>" wpf-tooltip-position="top><i class="fab fa-hotjar"></i></a>
<a class="wpf-threads-filter wpf-unsolved" data-filter="unsolved" wpf-tooltip="<?php echo esc_attr(wpforo_phrase( 'Unsolved', false )) ?>" wpf-tooltip-position="top"><i class="fas fa-times-circle"></i></a>
<?php endif; ?>

Please don't forget to use the update-safe way for the customization.  Instruction is here: https://wpforo.com/docs/root/forum-themes/theme-customization/

Reply
netvilox
(@netvilox)
Joined: 3 years ago

Trusted Member
Posts: 64

@sofy

There are many filed in the folder you mentioned above please specify. 

 

 

Reply
Sofy
 Sofy
Admin
(@sofy)
Joined: 5 years ago

Support Team
Posts: 4057

Sorry @netvilox,

The post above is just updated. Please check it.

 

Reply
netvilox
Posts: 64
Topic starter
(@netvilox)
Trusted Member
Joined: 3 years ago

@sofy

I tested the above code on local host but It didn't work. I saw the code on layout/4/forums

The resolved icon is highlighted but the topics it shows is the recent topics. see screenshots below.

And the trending topics icon is gone. 

Reply
1 Reply
Robert
Admin
(@robert)
Joined: 6 years ago

Support Team
Posts: 9373

@netvilox,

That's good. Now you should change the default thread loading logic.

1. Edit the copied layouts/4/forum.php file in your active theme folder and find this line:

$args = array( 'row_count' => WPF()->forum->options['layout_threaded_intro_topics_count'], 'forumids' => $child_forums, 'orderby' => 'type, modified', 'order' => 'DESC' );

2. Change it to this and save:

$args = array( 'row_count' => WPF()->forum->options['layout_threaded_intro_topics_count'], 'forumids' => $child_forums, 'orderby' => 'type, modified', 'solved' => 1, 'order' => 'DESC' );

 

Reply
netvilox
Posts: 64
Topic starter
(@netvilox)
Trusted Member
Joined: 3 years ago

Thanks you very much @sofy and @Robert.

Actually I don't want all the topics created to show on the homepage. So after adding the above code I changed the name on phrases from 'solved'  to 'move to homepage'. Now only the topic I want will be shown on the homepage. 

Thank once again to the Wpforo team.

Reply
Share: