MyBB Documentation

Latest News Bar

The 1.6 Documentation is no longer maintained and some information may be outdated.

The MyBB 1.6 series reached end of life on October 1, 2015.

This means there will be no more security or maintenance releases for these series and forums running these versions of MyBB may be at risk of unfixed security issues. All administrators are strongly encouraged to upgrade their forums to the latest release of MyBB as soon as possible.

The MyBB Community Forums has a bar at the top of the index page. This is a simple template modification as follows:

For the bar only on the index page, follow this procedure:

  1. Go to Admin CP --> Templates & Style --> Templates --> *expand your template set* --> Index Page Templates --> index.
  2. Find:
    {$headerinclude}
  3. Add after:
    <style type="text/css">
    .newsbar {
    	background: #D6ECA6;
    	border-top: 2px solid #8DC93E;
    	border-bottom: 2px solid #8DC93E;
    	text-align: center;
    	margin: 10px auto;
    	padding: 5px 20px;
    	font-weight: bold;
    }
    </style>
    
  4. Change the colors above to the colors of your choice if you wish.
  5. Find:
    {$header}
  6. Add after:
    <p class="newsbar">Your Important Announcement Here</p>
For multiple news bars, repeat step 6. For multiple news bars in different colours, you'll need to duplicate the CSS with a different class name (say .newsbar_red) and change the CSS colours accordingly. Then you will need to use
<p class="newsbar_red">...</p>
for example in your code.

For the bar to show up on all pages, follow this procedure:

  1. Go to Admin CP --> Templates & Style --> Templates --> *expand your template set* --> Ungrouped Templates --> headerinclude.
  2. At the end of the template, add:
    <style type="text/css">
    .newsbar {
    	background: #D6ECA6;
    	border-top: 2px solid #8DC93E;
    	border-bottom: 2px solid #8DC93E;
    	text-align: center;
    	margin: 10px auto;
    	padding: 5px 20px;
    	font-weight: bold;
    }
    </style>
    
  3. Change the colors above to the colors of your choice if you wish.
  4. Go to Admin CP --> Templates & Style --> Templates --> *expand your template set* --> Header Templates --> header.
  5. At the end of the template, add:
    <p class="newsbar">Your Important Announcement Here</p>
For multiple news bars, repeat step 6. For multiple news bars in different colours, you'll need to duplicate the CSS with a different class name (say .newsbar_red) and change the CSS colours accordingly. Then you will need to use
<p class="newsbar_red">...</p>
for example in your code.

Edit this page on GitHub