Quantcast
Channel: bbPress.org » All Posts
Viewing all articles
Browse latest Browse all 3638

Reply To: bbpress and child theme

$
0
0

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.

http://codex.wordpress.org/File:Template_Hierarchy.png

This one explains in my opinion much better whats going.

http://yoast.com/wordpress-theme-anatomy/

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.php

When 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.


Viewing all articles
Browse latest Browse all 3638

Trending Articles