admin
This user hasn't shared any biographical information
Posts by admin
Wordpress Adsense Shortcode
November 11, 2009 - 8:53 pm
Tags: adsense, custom function, shortcode
Posted in Wordpress Hack | No comments
function showads() {
return ‘<div id="adsense"><script type="text/javascript"><!–
google_ad_client = "pub-XXXXXXXXXXXXXX";
google_ad_slot = "4668915978";
google_ad_width = 468;
google_ad_height = 60;
//–>
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>’;
}
add_shortcode(’adsense’, ’showads’);
Display Random Posts in Wordpress
November 8, 2009 - 12:31 am
Posted in Wordpress Hack | 1 comment
<ul>
<?php
$rand_posts = get_posts(’numberposts=10&orderby=rand’);
foreach( $rand_posts as $post ) :
?>
<li><a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
<?php the_time(’M d Y’); ?>
</li>
<?php endforeach; ?>
</a>
</ul>
