Featured Posts

Five Wordpress Plugins you SHOULD be using and probably... It's been a while since I shared a couple of Wordpress Plugins with you. In fact, my Last Post on the subject is almost a year old at this point (ok, its 11 months today)....

Readmore

GoogleWave a second Opinion [caption id="attachment_1931" align="alignleft" width="150" caption="Google Wave in Chrome"][/caption] So back in October I posted about my first impressions with google wave....

Readmore

How can twitter help my website? Lots. As a comment on my post about Twitter Wit, someone queried "How can Twitter help my website?" A good question, I thought, and one that I felt needed more then just a reply...

Readmore

WiiView: Pirates Hunt for Blackbeards Treasure! While the wii is out visiting the repair shop (no word yet on when its due back) I thought I'd go ahead and do something I've been meaning to do for a while... Review some...

Readmore

SugarSync Redux So somewhere around two weeks ago, I talked about SugarSync. I was pretty impressed with it and the ability to share documents between my desktop, laptop and blackberry...

Readmore

Delusions of Grandeur Rss

Woah. Look. At. That!

Posted on : 10-06-2009 | By : mcangeli | In : wordpress |

0

wordpressworld So I’ve been playing with the new theme a little more (in case you haven’t noticed). In addition to adding more of the ads back, I’ve added a couple of cool hacked up widgets thanks to the PHP Code Widget and a super cool article that I found at SmashingMagazine.

If you peruse the right side, you’ll notice to new additions to the list. Upcoming Posts and Past Year. Upcoming Posts is just that. Posts scheduled to be published sometime in the future. Could be tomorrow. Could be next week, could be in 2011. Whenever. It simply displays a list of the posts scheduled to be posted. Its pretty cool and for things that you want to have auto posted and you want your readers to know is in the pipe, it works well.

The code is simple and is making good use of the query_posts loop in word press. See?

<?php query_posts(’showposts=10&post_status=future’); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<h2><?php the_title(); ?></h2>
<span class=”datetime”><?php the_time(‘j. F Y’); ?></span></p>
<?php endwhile;
else: ?><p>No future events scheduled.</p>
<?php endif; ?>

Granted, I cleaned it up a little and made some formatting changes to fit, but it works wonders.

The second one is the Past year articles. This one actually functions differently then I had expected. It figures out the date and it published the articles published on the 10th (for example) of the month for the past twelve months. You could modify it of course, to give you almost anything else or limit it to one post. I made a change to clean it up a bit and actually link to the article. Here’s my code:

<?php
$current_day = date(‘j’);
$last_year = date(‘Y’)-1;
query_posts(‘day=’.$current_day.’&year=’.$last_year); ?>
<ul>
<?php
if (have_posts()):
while (have_posts()) : the_post(); ?>
<li><strong><a href=<?php the_permalink();?>><?php the_title(); ?></a></strong><br>
<span class=”datetime”><?php the_time(‘j. F Y’); ?></span><br>
<?php
the_excerpt();
?></li>
<?php endwhile;
endif;
?> </ul>

Which is a little different then the code provided in the article and I’m still tweeking it a little bit.

Its amazing what you can do with WORDPRESS! Its almost easier then driving an rv.

Related External Links

Generated by LinkCurl

Blog Widget by LinkWithin

Popularity: 1% [?]

  • Share/Bookmark

Comments are closed.

Additional comments powered by BackType