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 characters
//* Remove first image from posts that published before 2014 | |
function remove_first_image ($content) { | |
if (!is_page() && !is_feed() && !is_home()&& get_the_date('Y')<2014) { | |
$content = preg_replace("/<img[^>]+\>/i", "", $content, 1); | |
} return $content; | |
} | |
add_filter('the_content', 'remove_first_image'); |
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 characters
//* Remove first image from single post | |
function remove_first_image ($content) { | |
if (!is_page() && !is_feed() && !is_home()){ | |
$content = preg_replace("/<img[^>]+\>/i", "", $content, 1); | |
} return $content; | |
} | |
add_filter('the_content', 'remove_first_image'); |
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 characters
.adsense_above_post { | |
text-align:center; | |
margin:30px auto; | |
} | |
.adsense_before_footer { | |
clear: both; | |
text-align:center; | |
margin:30px auto; | |
} |
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 characters
<div class="adsense_above_post"> | |
<script type="text/javascript"><!-- | |
google_ad_client = "ca-pub-xxx"; | |
width = document.documentElement.clientWidth; | |
/* Display Mobile Ads */ | |
google_ad_slot = "xxx"; | |
google_ad_width = 320; | |
google_ad_height = 50; | |
/* Display 336x280 if screen bigger than 480px */ |
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 characters
/** Add Adsense above post title */ | |
add_action( 'genesis_before_post', 'adsense_above_post' ); | |
function adsense_above_post() { | |
if (is_singular( 'post' )){ | |
require(CHILD_DIR.'/adsense_above_post.php'); | |
} | |
} | |
/** Add Adsense above footer */ |