-
-
Save Temmyhlee/c9afb4dba99641f99efaba7fe8a71b86 to your computer and use it in GitHub Desktop.
Revisions
-
srikat revised this gist
Oct 18, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ * Scope: Posts page and all category archives. * * @author Sridhar Katakam * @link http://sridharkatakam.com/display-random-ad-every-second-post-genesis/ */ function google_ad() { -
srikat revised this gist
Oct 18, 2014 . 2 changed files with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ <?php //* Do NOT include the opening php tag add_action( 'genesis_after_entry', 'google_ad' ); /** * Insert one random ad after every second post. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ .adsense { margin-bottom: 60px; } -
srikat created this gist
Oct 18, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ add_action( 'genesis_after_entry', 'google_ad' ); /** * Insert one random ad after every second post. * * Scope: Posts page and all category archives. * * @author Sridhar Katakam * @link http://sridharkatakam.com/ */ function google_ad() { if ( ! ( is_home() || is_category() ) ) { return; } if ( ! function_exists( 'dfads' ) ) { return; } global $wp_query; if( ($wp_query->current_post % 2) == 1 ) { echo dfads( 'groups=50&limit=1&orderby=random&container_class=adsense' ); } }