- This topic is empty.
-
AuthorPosts
-
July 5, 2024 at 9:07 am #25437
Thomas
GuestThis problem has been around a long time and still not many good solutions:
Besides manually creating template files for every piece of bbPress, which most website owners are not able to do
July 5, 2024 at 9:10 am #25438Arthur
GuestHow do I get bbpress pages to use a specific page template in WordPress?
You can try creating
bbpress.phpor justforum.phpfor just the forum index page, but then there is no content/loop loaded for the forum indexJuly 5, 2024 at 9:12 am #25439Doris
Guestsounds like most users just want bbpress forums to use “no sidebar” page template, and they have a page called “Forum” but
page-forum.phpdoes not work and you can’t also change the page template inside the post editor window either, this is because bbPress does not consider that to be a page… it is archives.so you can also use
archive-forum.phpinstead offorum.phpJuly 5, 2024 at 9:13 am #25440Ann
GuestI tried it.
forum.php did not work, but archive-forum.php did work
ONLY for the forum index page.
July 5, 2024 at 9:15 am #25441Doris
Guestbbpress documentation is really bad and outdated btw….
July 5, 2024 at 9:18 am #25442Susan
GuestIf you don’t want to create a fully custom template for the forum index (or topics etc) and just want to use the WordPress post editor to manage the forum index contents, I don’t think there is a solution because bbPress does not consider that to be a page. If you don’t have any bbPress template files, you can trick bbPress by create a page called /forum/ or /forums/ depending on your bbPress settings, and then edit the loop with the post editor. And because of WordPress loading order, it will load the page first, and show that to users, so it is kind of skipping the bbPress loading order which would otherwise hit index.php I believe.
However you can’t choose the page template in this method. bbPress will force-load the layout of index.php or page.php regardless of your /forum/ page template settings. So ironically it will display the loop content, but ignore the chosen template.
July 5, 2024 at 9:52 am #25443Robert
GuestPretty much you would need to have a template like
forum.phpand then instead of having a normal loop like:<?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php the_content(); ?> <?php endwhile; endif; ?>you have to call the loop of the specific page you want to use, eg. /forum/ or whatever.
$id=47; $post = get_page($id); $content = apply_filters('the_content', $post->post_content); echo $content;July 5, 2024 at 2:11 pm #25450Frances
Guestbut still requires custom hardcode yeah?
July 5, 2024 at 2:12 pm #25451Gloria
GuestOkay folks:
https://github.com/littlebizzy/hovercraft/blob/master/archive-forum.php
HoverCraft has a solution for this now.
Simply make sure you have a page with the slug “forum” a.k.a. /forum/ and the theme will automatically use the title and post content for the bbPress forum index. We might add the option later to choose the page you want to use in the Customizer, but for now it seems logical that most sites will use /forum/ for the bbPress index.
August 25, 2024 at 7:44 am #26298 -
AuthorPosts