Archive for January, 2006

Multiple Loops in Wordpress

I wanted to run the wordpress loop on my php page more than once, & I don’t know if I’m the only person, but I found the offical multiple look example hard to swallow.

Google found is nima’s how to which was useful, but I wanted to take it further; the problem was I wanted a function.

This is what I came up with:

<?php
require(’path_to_wordpress/wp-blog-header.php’);
?>

<?php
function show_posts_from_cat($MYCAT){

?>

<ul>
<?php if (have_posts()) : ?>

<?php $my_query = new WP_Query(”category_name=$MYCAT”); ?>

<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<li>

Google Adsense code (javascript) in wordpress pages / posts

For ages I could not work out why google ad’s included within a wordpress page didn’t work (in fact this applies to a post too). When google support pointed out that there was <br/> ’s in my code the penny finally dropped.

So here’s the deal, I pasted the following code into my page: (In the wordpress dashboard)

firefox ad
<!– FireFox Referral –>
<script type=”text/javascript”>
<!–
google_ad_client = “pub-6732086233580907″;
google_ad_width = 180;google_ad_height = 60;
google_ad_format = “180×60_as_rimg”;
google_cpa_choice = “CAAQyaj8zwEaCIwcWMzeycafKMu293M”;
//–>
</script>
<script type=”text/javascript” src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”></script>

adsense ad
<!– Adsense Referral–>
<script type=”text/javascript”>
<!–
google_ad_client = “pub-6732086233580907″;
google_ad_width = 180;
google_ad_height = 60;
google_ad_format = “180×60_as_rimg”;
google_cpa_choice = “CAAQ__qy0gEaCP_s0gMhUOtXKL3D93M”;
//–>
</script>
<script type=”text/javascript” src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”></script>

2006 - Year of calcylator ?

So It’s the new year, and I wanted to post an update about what’s happening over at calcylator.com. I guess it’s been nearly a month since there has been any visible activity, and I’d like to explain the reasons why.