bbpress and child theme
-
http://wordpress.org/support/topic/bbpress-and-child-theme-help?replies=2#post-4262464
Hi, I’ve started a support on wordpress.org but now reply yet. Can someone show me how to create a child theme since my theme is not compatible with bbpress.
Thanks
-
You can’t really create a Child Theme for bbPress only.
But if you like to work with the Child Theme idea – I personally think it fails big time but some people really like it then just create a Child Theme if you would do the WP way.
https://codex.wordpress.org/Child_ThemesAfter that you simply add a folder called bbpress inside your Theme or Child Theme folder and copy-/paste the files over from your Plugins directory to your Theme or Child Theme directory.
wp-content / plugins / bbpress / templates / defaults / extras / All those files are general Theme template files and will be read first if you copy them inside your Child Theme folder
wp-content / plugins / bbpress / templates / defaults / bbpress / All those files are bbPress (forum) templates files and will be read first if you copy them inside your Child Theme/bbpress folder.
An image will show you better..
andThanks for reply, I didn’t know you replied because I didn’t receive any email.
lets say I don’t want to use a child theme.
1. create bbpress folder on my theme folder.
2. copy all files from [wp-content/plugins/bbpress/templates/defaults/bbpress/All those files are bbPress (forum)] to my created bbpress folder
3. copy all files from [wp-content / plugins / bbpress / templates / defaults / extras / All those files are general Theme] to my /wp-content/theme/mytheme directory.I wasn’t sure if i need to copy all or just what I need. Also you have bbpress.css and forum.css files…are these also included in bbpress package?
so when i type http://www.mytheme.com/forums the new template should appear?
Yes thats true, first of all you should only copy the files that you need to edit.
Just copying everything works fine but isn’t needed because inside the bbPress core is a function whats called Theme_Support ( i believe thats what its called ) And this function does only one thing, before reading all template-files.
Check if the needed template file is inside your theme folder. If it’s not.. –> use the template file inside the plugin folder.
bbPress plugin template files are the default template files but when you copy them over to your theme the new copied files become default.
It’s serious one of the most beautiful and easy constructions I’ve ever seen used at CMS’s. I’ve worked with manny other forum-software that had many more options and features as bbPress but they never had this easy way of safely -editing template files.bbpress.css works 100% the same copy the bbpress.css file to a folder called CSS inside your theme folder and it works the same way. The forum.css file at the picture isn’t bbPress, thats something I created manually and has nothing to do with bbPress.
Those are two fast screenshots of what I made without having any PHP skills, I just understand HTML + CSS.
Thanks Shmoo for all the help. Unfortunately I don’t know which file to copy so to be safe I’ll copy everything to my child theme.
I’m also trying to remove my main theme’s sidebar for my forum with no success. I’ve read other post and this seems to work:body.bbPress #sidebar {display:none;}
body.bbPress .post {width:100%;}I put those on both my bbpress.css and the style.css but it doesn’t seem to work.
This is my website: http://ps4evolution.com/forums/
Well to now what file you have to get isn’t really that difficult, you just need a little understanding of what files will be loaded when view a specific page.
This is a good sheet to show you the logic, but it can be difficult te read.
https://codex.wordpress.org/File:Template_Hierarchy.pngThis one explains in my opinion much better whats going.
But it’s not too difficult, lets say you’re on the homepage of your website.
Often the index.php is need to start. If you open the index.php you see at the top something like this<?php get_header(); ?>
the funny thing about PHP is that you can alsmost read-/understand what it is going to do. Like the code tag above says get_header so on that position it will grab the header.php file and open it. Keep following all those files and you will be okay.
Think of it as LEGO – building blocks – it needs a few blocks to make a house and a webpage is the house.—
For the forum (bbPress) side I can tell you that the homepage of the forum is the page where it shows all forums & categories. This is called an archive page and not a regular page.php what most people would think when they first start.
Normally if it’s an archive page WordPress would load the archive.php template but because we have a Post_Type created by bbPress called Forum we can add the Post_Type_Name behind the archive.php – like this: archive-forum.phpWhen you copy that archive-forum.php file form your extra’s (plugins) folder to your Theme folder and open it you will again see the
<?php get_header(); ?>
stuff and all other typically WordPress stuff.To remove the sidebar of the main forum-page you just go into that archive-forum.php template and delete the code that called the sidebar:
<?php get_sidebar(); ?>
Just like the header it’s telling you what it does -> GET Sidebar ( load the sidebar files )It’s really just trying and not being afraid. Them ore you do it the better you get at it.
*** Never try to edit files on a working website – online ***
Install WordPress + your website on your computer locally, get a code editor – edit the files and check if everything is working. When your finished editing and everything is Fonzy cool you can upload and overwrite the files at your online-server.
You know how I got my start (years ago) while not knowing what files to edit – By just opening some files I thought could be the files I needed. Typing 55555555555 or something else inside the file – Save it – reload the page in the browser and if 55555555555 didn’t show-up on the webpage I knew it wasn’t that template I was looking for and kept searching for the right one.
Don’t be afraid to make mistakes… You gonna make some trust me, but when you have a back-up file or you can simply undo your edit inside the Code-editor ( CMD + Z ) you’re all fine.
I tried your advice and edit out [<?php get_sidebar(); ?>] from achive-forum.php but side bar is still there.
I installed Microsoft WebMatrix and starting my own local website. I’ll see what I can do with it 🙂
Thanks for the advice and hopefully I can figure this out soon.I have no idea what’s going on, I think my theme doesn’t support bbpress. I removed [<?php get_sidebar(); ?>] from all the file I copied from the EXTRAS folder but the side bar is still there. I switched to twenty eleven them and the forum page seems to work properly without the side bar. And I haven’t copy any file from bbpress and extras folder.
Shmoo, do you know a way to get around this?EDIT: OMG, I’m so stupid…it’s so simple. All I need to do was create a new page, Select Content Layout as NO SIDEBARS, then select template bbpress forum…
I still need more experiment before I can transfer to my website. 🙂
I spoke too soon lol….
the format I would get is Home>forums>forumsTest
the Forumstest I created would have no sidebars, as soon as I click on Forums or any of the post the sidebars would return
- You must be logged in to reply to this topic.