Notifications
Clear all

wpForo 1.x.x [Closed] make homepage show only resolved topics

10 Posts
4 Users
0 Reactions
1,390 Views
netvilox
Posts: 64
Topic starter
(@netvilox)
Estimable Member
Joined: 6 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)
Estimable Member
Joined: 6 years ago

What about this please

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

Member
Posts: 1862

@netvilox,

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

 

netvilox
(@netvilox)
Joined: 6 years ago

Estimable Member
Posts: 64

@alvina OK thanks s million times

 

Sofy
 Sofy
Admin
(@sofy)
Joined: 7 years ago

Support Team
Posts: 4900

@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/

netvilox
(@netvilox)
Joined: 6 years ago

Estimable Member
Posts: 64

@sofy

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

 

 

Sofy
 Sofy
Admin
(@sofy)
Joined: 7 years ago

Support Team
Posts: 4900

Sorry @netvilox,

The post above is just updated. Please check it.

 

netvilox
Posts: 64
Topic starter
(@netvilox)
Estimable Member
Joined: 6 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.Β 

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

Support Team
Posts: 10591

@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' );

Β 

netvilox
Posts: 64
Topic starter
(@netvilox)
Estimable Member
Joined: 6 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.