RSS Feeds

admin

This user hasn't shared any biographical information


Posts by admin

Wordpress Adsense Shortcode

November 11, 2009 - 8:53 pm

Tags: , ,
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>

Display Subpage Nav in Wordpress

November 6, 2009 - 10:17 pm

Posted in Wordpress Navigation | No comments

<?php
$children = wp_list_pages(’title_li=&child_of=’.$post->ID.’&echo=0′);
if ($children) { ?>
<?php echo $children; ?>
<?php } ?>