Posts Tagged ‘code’

Changing the default month or day for an embedded Google calendar

Thursday, May 14th, 2009

How to embed a public Google calendar on your page: Embed on your website

Want to change which month or day the calendar displays on load? I found the answer on this Mark Mail page. Just include date values in the parameter string like so:

...&ctz=America/Los_Angeles&dates=20090901%2F20120901

It also looks like you can pass other parameters to control color, etc.

Popularity: 49% [?]

How to show only your single latest post on your Wordpress home page.

Tuesday, July 29th, 2008

Wordpress Settings > Reading - setting the number of posts per pageIn Wordpress 2.x under Settings > Reading, you can set a number for “Blog pages show at most”.  This applies globally, however.  I discovered a method to make your home page to show only the latest post, while allowing all other blog pages to respect the “at most” number.

In index.php, just before the loop, I added the following line:

<?php query_posts('showposts=1'); ?>

Basically, that sets up a preemptive query and grabs only the latest post, rather than allowing the loop to query the latest “at most” number of posts.

Popularity: 55% [?]