Use the Simple Module in a Theme Template
Now let's add the banner to every page in your site's theme.
Open your theme's
header.phpand add the following code to the end of the file (assumes the end of the file is in HTML context, not PHP context):
<?php LawPress::the_latest_news_html(); ?>
You now should have a red "Latest News" header on every page of your website.
- You now have something you can view on your site. Test it!
What Did We Just Do?
We added a white on red banner to be displayed at the top of every page on your site.
_LawPress_Latest_Newswas made possible by the Helper functionality in WPLib.
- This Helper functionality allows you to build large Applications with your code in a well-organized set of files but it makes it much easier for your themers to learn your API since they only need to learn the method names and not all the class names.