extension joomla, template joomla,banner extension joomla,jomla slider,slider joomla

Adding Content To An Action Hook

 

Let’s do something practical we’ll add a “Welcome To My Blog” blurb just below the header of the Thematic Theme using the Thematic Action Hook, thematic_belowheader(). Place the following code snippet in your Child Theme functions.php file.

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
// First we make our function
function childtheme_welcome_blurb() {
 
// We'll show it only on the HOME page IF it's NOT paged
// (so, not page 2,3,etc.)
if (is_home() & !is_paged()) { ?>
 
<!-- our welcome blurb starts here -->
<div id="welcome-blurb">
<p>Welcome to <?php bloginfo('name'); ?>.</p>
</div>
<!-- our welcome blurb ends here -->
<?php }
 
} // end of our new function childtheme_welcome_blurb
 
// Now we add our new function to our Thematic Action Hook
add_action('thematic_belowheader','childtheme_welcome_blurb');

Make sure you read the comments in the code snippet. It’s easy as cake! Want to add something to a WordPress Theme without touching the files and making a headache for yourself when it comes time to upgrade? Just find out where the Action is!