WordPress Tips: Post Count and Current Post

Posted on

Recently, I added Google AdSense to my site. I wanted to have an ad beneath the last post on each page, and another ad in the middle of pages with multiple posts. To do this I needed to figure out the total number of posts in the current loop. I had a hard time figuring out how to do this so I wanted to share what I learned.

The $post_count and $current_post properties of the WP_Query class provide the total number of posts in the query and the index of the current post respectively. By using these two values I was able to identify the middle post and the last post on every page.

Continue reading

It Gets Worse for John McCain

Posted on

Once universally respected as the Right’s voice of reason, John McCain has become the poster boy for angry old white men. It’s sad because I don’t think he knows it happened. As recently as 2004 McCain seemed like a lock to win the presidency. Democrats loved John McCain, and it took a concerted effort for him to lose their support.

Unfortunately he did lose their support, but it wasn’t recently that he lost their respect. This upsets me because I truly believe John McCain has dementia. The things that he’s said recently do not reflect the man he once was. His outburst during the DADT debate left many shaking their heads, but it wasn’t the first time. Violent anger and aggression are a common symptoms of Alzheimer’s, and it seems that Mr. McCain is getting worse.

Continue reading

Carl Sagan: Astronomy’s John Lennon

Posted on

On December 20th, 1996 the world lost one of its greatest minds. Over a decade later Carl Sagan remains, in many minds, the voice of astronomy. His greatest contribution to our understanding of the universe did not come from his scientific discoveries, but from his skills as a communicator.

Carl Sagan was a teacher. I remember watching Cosmos as a child and hanging on every word. He had the ability to explain a complex universe in a way that I, even as a child, could grasp. This ability made him rare among scientists, who are often unable to communicate ideas without the use of jargon or complicated comparisons.

Continue reading