bbPress

Simple, Fast, Elegant

bbPress support forums » Installation

hide subforums on main page

(10 posts)
  • Started 9 months ago by Deesdogcare
  • Latest reply from che1959
  • This topic is resolved
  1. I have tried a variety of codes that have been offered up in these forums in an attempt to hide subforums on my main page because one of my parent forums is dog breeds~~~ can you imagine how HUGE my front page will beonce I add in all of my subforums?

    All of my attempts to utilize code offered in the forums has failed. One piece looked likeit MIGHT do what I wanted, but I could never figure out where to paste it!

    Please forgive me for my lack of knowledge ~~~ I am learning as I go.

    I have pasted my code for my front-page.php into the paste bin. If you could look at it and give me a clue, I'd appreciate it!!!

    http://pastebin.com/m4e612460

    Thanks!
    D

    Posted 9 months ago #
  2. If you are asking what I think you are asking, I think I have made the subtle change you need. The sub-forums will no longer be shown on the front-page.

    http://pastebin.com/m5ce19f4b

    Line 53 is really all that's needed.
    if (!$forum->forum_parent) {
    This is untested however.

    Topics from within the sub-forums will still showup in the latest discussions however.

    Posted 9 months ago #
  3. That did exactly what I was wanting on the front page, but now you can't find the subforums at all. I had thought that when I clicked the parent forum it would automatically show the subforums ~ either on the front page or on a new page. Instead, it just goes to an "Add a topic" page. Any ideas?

    Please forgive my bad spacing at times. When I'm in firefox, this doesn't happen because of auto-spellcheck, but in IE, I miss fixing some of it. I messed up the spacebar on this keyboard and it doesn't alway space like it should =(

    Thanks _ck_!

    D

    Posted 9 months ago #
  4. OH ~ and I had actually tried a copy & paste of the code that you changed through finding it in another thread, but there was some kind of error in his syntax, cause it just gave me error messages.

    Posted 9 months ago #
  5. When you go into a forum, it should show you all the sub-forums available. If there are no topics in that forum however, it may just immediately jump to add new topic - that may be a bug in how bbPress works. Try creating a test topic in the main forum that has sub-forums.

    If your forum has topics and still does not show sub-forums, you edited your theme somewhere and removed it or you are using a theme that removed the feature. If so, put into pastebin your forum.php page from your theme and show it to me.

    Posted 9 months ago #
  6. I don't know whether I did it or if it was in the template I modified, but posting a topic in the main Dog Breed Forum didn't correct the issue. I posted my forum.php code in the pastebin:

    http://pastebin.com/m61cf1802

    Thanks,_ck_ ~ I only hope that I understand php and bbpress forums as well as you do one day!

    D

    Posted 9 months ago #
  7. Somehow you removed the sub-forum code from your theme.
    Here's a guess at the correctly inserted code:
    http://pastebin.com/m33722e18

    Posted 9 months ago #
  8. I'm not surprised . . . I know so little about php that trying to use code snippets and paste them into my pages, the deleting them if it didn't work is creating havoc for me. The code you left in the paste bin fixed my problem! =)

    This is whyI made the offer I did last night ~~~ I feel bad always having to have you do more than you would have to for someone who is well-versed in the language and design of the forums ~~~ and there are a lot of issues that I don't know how to resolve. If I post them all, I'm going to bust the boards! LOL

    Thanks for the code, _ck_!!!! Now my subforums are showing when I click the main forum from my front page =)

    D

    Posted 9 months ago #
  9. by the way, an even better way to implement this is to use the args of bb_forums() properly... namely if you change your theme to call bb_forums("depth=1") you will only get 1 level of forums on the page.

    This change can be made to the front-page or forum of your theme. If your theme calls bb_forums($forum_id) then it is asking for the child forums of the existing forum and you need to change the code to something like this... bb_forums("depth=1&child_of=$forum_id")

    Posted 8 months ago #
  10. che1959
    Member

    Thanks, Zappoman, your way worked perfectly.

    Posted 7 months ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.