#1 WordPress forum plugin created by gVectors Team

wpForo – WordPress Forum Plugin
  • Home
  • Forum
  • Migrate to wpForo
  • Addons
  • Documentation

Forum

Home | Forum

wpDiscuz - WordPress Comment Plugin
  • Forums
  • Members
  • Recent Posts
Forums
Main Support Forums
How-to and Troubles...
Sub Forum Layout
 
Share:
Notifications
Clear all

[Solved] Sub Forum Layout  

Page 1 / 2 Next
    Last Post
RSS

jwhit16
Posts: 17
 jwhit16
Topic starter
April 19, 2020 5:27 pm
(@jwhit16)
Active Member
Joined: 9 months ago

Hi, I previously posted a topic on this and it appears to be closed.

I am considering purchasing 3-4 addons, but sub-forum layout is a major issue that may prevent me from moving forward.

Here is why. I plan to add 50-100 sub forums for each forum, they will be organized by location. So only 1, or possibly none of these sub forums will be relevant to a new user who wants to view the forum.

When that user clicks on a main forum, they will have to scroll past all 50-100 sub-forums to see the topics from the main forum.

Here is what it looks like with only 10 or so sub forums: https://gigsharks.com/community/delivery-amazon-flex/

I would like to offer a few potential solutions.

1) Show main forum content before sub-forums.

2) Enable a sub-forum drop down menu.

3) Enable sub-forum pagination.

All of these solutions benefit user experience for anyone using WP Foros. I am very pleased with the plugin overall, and hoping to invest in some add-ons. But unfortunately this is a major design flaw that I believe has enough negative impact on user experience to keep me from investing in additional add-ons.

If there is CSS that could accomplish any of the above resolutions please let me know.

Topic Tags
sub forum
10 Replies
Robert
Posts: 7572
 Robert
Admin
April 20, 2020 8:57 pm
(@robert)
Support Team
Joined: 5 years ago
Posted by: @jwhit16

1) Show main forum content before sub-forums.

2) Enable a sub-forum drop down menu.

3) Enable sub-forum pagination.

Thank you for the suggestions @jwhit16,

We've added this in our to-do list. Currently, let's try to create the #2 using a simple custom code. But it'll look like this and it'll jump to selected sub-forum once you choose it:

 

 

Please follow the instruction below:

1. Put this function in your active WordPress theme functions.php file:

function wpforo_custom_subforum_dropdown(){
if( function_exists('WPF') ){
if ( WPF()->current_object['template'] == 'topic' && wpfval(WPF()->current_object, 'forum', 'url')
) {
$args = array( "parentid" => WPF()->current_object['forumid'], "type" => 'forum' );
if( $forums = WPF()->forum->get_forums( $args ) ){
?>
<div class="wpf-sub-wrap">
<select class="wpf-sub-forums" onchange="window.location = this.options[this.selectedIndex].value">
<option value="<?php echo esc_url_raw(WPF()->current_object['forum']['url']) ?>"><?php wpforo_phrase('Sub-Forums'); ?></option>
<?php
foreach ( $forums as $forum ){
if( WPF()->perm->forum_can( 'vf', $forum['forumid'] ) ) {
$forum_url = wpforo_forum( $forum['forumid'], 'url' );
echo '<option value="' . esc_url_raw( $forum_url ) . '">' . $forum['title'] . '</option>';
}
}
?>
</select>
</div>
<?php
}
}
}
}

 

2. Put this CSS code in Dashboard > Forums > Settings > Styles Tab > Custom CSS Code textarea. Save it, delete all caches and reset optimizer / minifier plugins cache if you have any:

#wpforo #wpforo-wrap.wpft-topic .cat-stat-questions,
#wpforo #wpforo-wrap.wpft-topic .cat-stat-answers,
#wpforo #wpforo-wrap.wpft-topic .cat-stat-posts{display:none;}
#wpforo #wpforo-wrap.wpft-topic .wpf-sub-wrap{width: 100%; background: #f5f5f5; padding: 10px; }
#wpforo #wpforo-wrap.wpft-topic .wpf-sub-forums{width: 90%; margin:0 auto 0px auto!important; display:block;}
#wpforo #wpforo-wrap.wpft-topic .forum-wrap {border-top: #cccccc 1px solid;display: none;}

 

3. Create an update-safe copy of wpForo Q&A layout forums.php file,

3.1 Create /wpforo/ folder in WordPress active theme directory,

3.2 Copy /wp-content/plugins/wpforo/wpf-themes/classic/forum.php file to the /wpforo/ folder,

3.3 Edit the copied /wpforo/forum.php file, find this part of code:

else : ?>
<p class="wpf-p-error">
<?php wpforo_phrase('No forums were found here.') ?>
</p>
<?php endif;

 

3.4. Add the new custom wpforo_custom_subforum_dropdown() function before that code. It should look like this:

wpforo_custom_subforum_dropdown();
else : ?>
<p class="wpf-p-error">
<?php wpforo_phrase('No forums were found here.') ?>
</p>
<?php endif;

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

1 Reply
jwhit16
 jwhit16
(@jwhit16)
Joined: 9 months ago

Active Member
Posts: 17
April 22, 2020 4:06 am
Reply toRobertRobert

@robert Thanks so much for the help I'll give this a try!

jwhit16
Posts: 17
 jwhit16
Topic starter
April 22, 2020 6:01 am
(@jwhit16)
Active Member
Joined: 9 months ago

When I made these updates, subforums display in view of entire community. When I click on main forum in which I have sub forums, the sub forums disappear completely. 

It's actually not a bad layout for the time being, but I would be curious to see the drop-down. I have cleared cache through WP Rocket

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

Support Team
Posts: 7572
April 22, 2020 9:05 am
Reply tojwhit16jwhit16

@jwhit16,

What do you mean saying "on entire community? It should not be displayed on the home page.

The sub forums should only be displayed in the parent forum page. For example, when you're on the home page, and you click on a parent forum title and go that forum page, instead of the sub-forum list you should see only the drop-down as I showed it on the screenshot.

Please let me know whet template file have you used to insert the function? You should use the forum.php file directly in the /wpforo/wpf-themes/classic/ directory.

Can I see a screenshot of your change and copied file?

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

jwhit16 liked
jwhit16
Posts: 17
 jwhit16
Topic starter
April 22, 2020 6:12 pm
(@jwhit16)
Active Member
Joined: 9 months ago

Thanks for your response. I was able to resolve after review. 

 

My only concern is whether I created the update safe copy correctly. I copied the forom.php part of the plugin and I have used File Manager in my hosting to create a WP Foro folder and save it under wp-content > themes. 

 

It is next to the folder I used for my child theme.

 

Is there a tutorial for this to check if I have saved correctly?

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

Support Team
Posts: 7572
April 23, 2020 3:32 am
Reply tojwhit16jwhit16

@jwhit16,

The /wpforo/ folder should be in the active child theme folder not next to.

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

jwhit16 liked
jwhit16
Posts: 17
 jwhit16
Topic starter
April 29, 2020 5:44 am
(@jwhit16)
Active Member
Joined: 9 months ago

I have followed these steps exactly. After adding /wpforo/ folder to child theme the changes have not been made.

The changes worked originally but it is not update proof, I lost changes on last update to plugin

Page 1 / 2 Next
  All forum topics
  Previous Topic
Next Topic  
Related Topics
  • Cross-Posting Ones Forum Between Categories
    4 months ago
  • How can I post the same forum on different pages on my website?
    9 months ago
  • How to add sub-forums in permalink?
    2 years ago
  • Sub forums or equivalent?
    2 years ago
Topic Tags:  sub forum (8),

Forum Search

Join Us!

Download wpForo plugin
on WordPress.org

wpForo Addons

wpforo-private-messages  wpforo-advanced-attachments-128x128  wpforo-embeds-128x128 wpForo User Custom Fields addon  wpForo – Blog Cross Posting addon  wpForo Ads Manager
View all Addons »

Recent Topics

  • Subscribing through the subscription manager in some cases doesn't update the "subscribe to topics" button on forum

    By afreymuth, 11 hours ago

  • a little problem, I need help, thanks

    By adultwork, 12 hours ago

  • How to configure: When click on Topic it goes to 1st page (Topic starter)

    By nalin_duminda, 14 hours ago

  • Seeking assistance solving new users not getting a confirmation emails on WP Multisite

    By Hansie, 15 hours ago

  • White text on White background...again and again...

    By Morosirus, 21 hours ago

  • display a shortcode in the category description

    By mazohho, 21 hours ago

Topic Tags

  • new features43
  • seo39
  • translation36
  • plugin conflict35
  • forum33
  • buddypress31
  • login31
  • threaded layout30
  • registration29
  • ultimate member28
  • moderation27
  • editor25
  • avatar24
  • shortcode24
  • css23
  • tags22
  • menu21
  • migration20
  • url20
  • profile20
View all tags (1474)

Recent Posts

  • RE: Fatal error:

    @robert OK, thanks my prob...

    By Bujkilla, 6 hours ago

  • RE: Views are no longer counted

    Again , Views are counted very well, but not in real...

    By Robert, 9 hours ago

  • RE: How are "views" calculated?

    Please read this topic attentive from first post. It's ...

    By Robert, 10 hours ago

  • Subscribing through the subscription manager in some cases doesn't update the "subscribe to topics" button on forum

    Hi,I think this is just a development oversight more th...

    By afreymuth, 11 hours ago

  • a little problem, I need help, thanks

    Hello,I'm not sure if I posted where I should, but I wa...

    By adultwork, 12 hours ago

  • How to configure: When click on Topic it goes to 1st page (Topic starter)

    Currently when click on topic it goes to the last page ...

    By nalin_duminda, 14 hours ago

  • Seeking assistance solving new users not getting a confirmation emails on WP Multisite

    Problem: When a new user registers through WPForo, they...

    By Hansie, 15 hours ago

Share:
  Forum Statistics
20 Forums
7,788 Topics
39 K Posts
5 Online
14.9 K Members

Latest Post: Fatal error: Our newest member: soikeotaixiu Recent Posts Unread Posts Tags

Forum Icons: Forum contains no unread posts Forum contains unread posts

Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Powered by wpForo | Copyright © 2016-2021 gVectors Team
Copyright Registration Service - Click here for more information or to register work
wpForo is Registered with the IP Rights Office
Copyright Registration Service

Ref: 4477265538
  • Home
  • Forum
  • Migrate to wpForo
  • Addons
  • Documentation