Category: Tutorials

Footer.php Action Hook

One piece of code that should be included with your theme, but is not required, is the action hook, wp_footer().

Most theme developers, however, do include this hook in the footer.php file. Personally, this hook should be required for all themes. Since it is optional, you need to add it to your footer.php file if it does not already exist. The cd-ad-sponsor plug-in uses this hook to reset the database table of sponsor ads that have been displayed.

Read More »

Embedding Ads Between Excerpts

One other modification you may want to make to your theme files is the ability to embed ads between excerpts. For example, let's say our index page displays ten excerpts per page, and we want to present an ad between every fourth excerpt. According to our layout sketch, this zone is identified as 3.

Read More »

Modifying Your Theme

Now that you have defined your sponsor ad data, we'll modify the theme to use this information. In order to enable the placement of your ads, you need to insert a simple function call at the appropriate position within specific theme files where you want the ads presented. Refer to our layout sketch to track the changes we make to the theme files.

Read More »