MyBB Community Forums

Full Version: Add custom HTML and CSS
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello all,

New here. I just converted my SMF 2 board to MyBB and that seems to have worked fine. Impressive! My SMF board has been running since June 2006, so lots of content.

My site is a bit old (currently redesigning, but that's months away) and I have this CSS stuff that allows me to have the site's menu permanently on the left side of the screen and the content on the right. For that to work, I need to include the CSS and also add a bit of HTML to some template on the board. The HTML is basically just to put the board inside a <div> with a specific so that it will show up on the right of the site's main menu.

In SMF I had modified the main template of the board to do that, but after roughly one hour I still can't find where I can make the equivalent change in MyBB.

Here's the HTML I need to insert:

<div id="nfNavMenu">
<?php include('menu.php'); ?>
</div>
  <div id="content2">

This essentially needs to come before any of the MyBB content on any page. In my SMF installation, that code shows up right after the <body> tag.

Come to think of it, if there's a place where I can add the closing </div> before </body>, that would be nice too. Wink

Any idea?

Thanks!
Michel
basically you have to use PHP in Templates plugin to include a php file AND
you can add required code segments in header & footer templates of the theme

css style properties can be added into global.css style sheet of the theme

see also templates related (brief) guidance & this css guidance [outdated]
Great, thanks! That worked. It was a bit of a chore adjusting the CSS to fit with the rest (just like when I did this with SMF a few years back), but now things seem to be working as expected. Smile