In order to track SEO metrics for my clients, I use the SEOMoz Pro service, which is a handy tool at monitoring SEO metrics (and so much more). I’ve noticed on one of the sites I manage through the service that I’ve been missing a number of meta description tags. For those unaware, meta description tags are used to give a brief and concise summary of content on a page. This helps search engines and potential readers understand what’s on the page. The meta description info is also often used in page summaries in search results from engines like Google. The below example is one from my music site, Electric Mohawk.
The example demonstrates the importance of meta description tags in SEO quite clearly. I noticed, though, that some of my pages on Electric Mohawk are turning up as missing meta description info in their tags. A prime example for my site is archive pages. My sites are typically built using WordPress, so archive pages are dynamically generated and compiled, usually based on the month content was published.
I typically do not make my archive pages searchable for SEO purposes, but some people may still want them archived and may still want them to include a basic description. The problem is, though, that many of us already use an SEO plugin of some sort, particularly All-in-One SEO Pack, where users do not get direct access to creating meta description tags for certain dynamically generated pages (any kind of archive page or page-navi generated page). Another issue is that by creating another meta description tag to compensate for this in the header.php file would cause duplicate description tags to be created if the content is not an archive page. I’ve created a simple workaround for WordPress archive pages to solve this problem.
Add this piece of code to your theme’s header.php file:
What this code is doing is simple. The if statement checks whether or not the page is an archive page. If it is an archive page, then it will echo out a portion of the meta description html tag. In between, I made a call to the_time() function that passes in the month and year. I then created another echo that gives the actual description.
Some of you may be wondering why there are two echo statements instead of a simple string concatenation. While I was debugging and testing out this code, the date would appear before the initial HTML tag, causing problems with formatting and validation. Creating a second echo seemed to solve the problem. Also, if the statement evaluates false, no additional tags will be generated.
I hope this snippet helps you out in some way. Have an alternative? Feel free to share!
Hello All,
I just wanted to send a shout out to all of you, my readers, and maybe first time visitors, and wish you a Happy Thanksgiving, wherever you may be.
A quick update: With graduation coming up for me in less than a month, it’s been a great 4 1/2 years that I’ve attended UWSP. Taking on 3 majors in such a short amount of time has not only been challenging, but a lot of fun. I’ve made a lot of friends, and will make many more after. With that said, I’ve accepted a job offer from one of my current employers, Sentry Insurance, working as a Java developer. While I cannot talk about what I will be working on, I will say this to all programmers: check out GoSu. It’s what I will be using along some in house libraries. The cool thing is that it reminds me of AS3… a lot… or any other ECMAScript derivative.
Thank you again, everyone. Your support means a lot.
Brett
Adobe Platform Evangelist Mihai Corlan discusses how to debug the code of a combined Flex and PHP project using Flash Builder 4 and Zend Studio 7.1. He reviews how to use breakpoints to test your application.
This is the 4th (and likely final) part of my PHP 101 series. This series of videos include how to solve the Pythagorean Theorem using math functions in PHP, diving more into some of the math functions that PHP has to offer, and creating a form and replacing hard coded variables with arrays.
To view other PHP tutorial videos
This is part 3 of the PHP 101 series I’ve put together on my site. this next round adds more complexity and shows you how to setup the Eclipse IDE for PHP development.
This video goes through the process of installing and setting up Eclipse for PHP development step-by-step.
This video demonstrates the basic mathematical capabilities of PHP. Concepts include
This video demonstrates how to build a basic math calculations using PHP. Concepts include
To view other PHP tutorial videos