Genesis-framework-design-tips

If you are using Genesis Theme Framework and would like to display Google Adsense or any advertisement code after the first post on the homepage, archives, and search results page, add the code below to the child theme’s functions.php file.
add_action('genesis_after_post', 'aycchildthemes_ad_after_first_post');
function aycchildthemes_ad_after_first_post() {
global $loop_counter;
if (!is_singular() && $loop_counter == 0) { ?>
ADD YOUR GOOGLE ADSENSE CODE HERE
<?php }
}

The code above which you add should be placed anywhere after this:
require_once(TEMPLATEPATH.'/lib/init.php');
And before the following closing code (if it exists):
?>

That’s it. Let me know your experience after using this snippet. Also please share if you have tricks complete this kinda job.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.