Blogs Merged

I have transferred and merged all of my previous blogs thanks to the easy WP export and import feature.

There maybe some disorganization of posts and categories along with the fact I have a generic theme running – all will be resolved… eventually.

WordPress – Archive List Current Year by Months and Historical Years

Just thought I would share my *a-ha* moment. Some of you might just call it an *duh* moment.

So, I needed to create an archive list for the sidebar of a new blog. I wanted the following format:

Jul 2011 (#)
Jun 2011 (#)
May 2011 (#)
Apr 2011 (#)
Mar 2011 (#)
Feb 2011 (#)
Jan 2011 (#)
2010 (#)
2009 (#)
2008 (#)

Easy to do one or the other with the built in WP function but not necessarily both – at least that is what I first thought.

My search found a combo of WP function and mySQL data call.

<ul>
	<li>
<ul> <!--?php wp_get_archives('type=monthly&#038;limit='.date('m').'&#038;show_post_count=1'); ?--></ul>
</li>
<!--?php wp_get_archives('type=yearly&#038;limit=1'); ?-->

<!--?php $years = $wpdb--->get_col("SELECT DISTINCT YEAR(post_date) FROM $wpdb-&gt;posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY post_date DESC");
unset($years['0']);
foreach($years as $year) :
?&gt;
	<li><a title="&lt;?php echo $year; ?&gt;" href="&lt;?php echo get_year_link($year); ?&gt;"><!--?php echo $year; ?--></a></li>
<!--?php endforeach; ?--></ul>

Fine but it didn’t show my post count for the years. So, tried to find a solution but that required more database stuff blah blah blah.

Then. It hit me.

Do it the simple way stupid.

Just do the following:

In the sidebar PHP or where you want the list.

<ul class="monthsList"> <!--?php wp_get_archives('type=monthly&#038;limit='.date('m').'&#038;show_post_count=1'); ?--></ul>
<ul class="yearsList"> <!--?php wp_get_archives('type=yearly&#038;show_post_count=1'); ?--></ul>

Then update your style.css

ul.yearsList, ul.monthsList { list-style: none; margin-top: 0; margin-bottom: 0; }
ul.yearsList li:first-child { display: none; }

Braaaaiiiins

Had some hard boiled eggs for breakfast and got a nice laugh at the same time.

These are the Cico egg cup from Alessi.

I think it is a great design including the cup, spoon and salt shaker which is the hat. For storage, put the hat on top and the spoon in hand and it keeps everything together.

Moods of Norway

Received a new pair of shoes since my current ones are getting pretty shabby.

I was looking for something that represented Norway and then came across Moods of Norway. Originally a fashion brand they have moved into shoes and other accessories. You can get them across Europe, Japan, Beverly Hills and New York.

More info here –> Moods of Norway