How to: add an alert box on the front page
I've had several cases where a client wants to have an alert show up on the front page -like a 'No School" announcement. Here is how to do it.
1) make sure you have the plugin 'exec-php' installed 2) go to MTO->Main Templates->+ Add main template 3) enter the name 'front-page' and copy 'index' and add the new template 4) edit the new 'front-page.php' 5) right after the line HTML Code:
<?php get_header(); ?> HTML Code:
<div id="fp-announce"> 6) go to Appearances->Widgets and you should see a new widget area 'front page alert' 7) add a text widget to the new widget area and insert the following code into it HTML Code:
<?php HTML Code:
div#fp-announce {background-color: yellow; margin-bottom: 0px;} Now when you want an annoucement to show on the front page, just create a post and give it the category 'annoucement' and it will show up. You can change the background color in the CSS to what ever you want. NOTE: give the post a date of a year ago so it won't show up on the first page of your posts in addition of being on the front page. |
All times are GMT -6. The time now is 05:22 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.