WordPress Opengraph and Microdata Generation without a plugin

Its really useful to have Opengraph (Facebook) and Microdata (Twitter) information in your blog header.

The Facebook Opengraph and Schema.org microdata lets you optimize your blog much more better and helps search engines to index your website better to show rich snippet.

It also lets Facebook and Twitter users to share your blog with proper title, description, url and image.

There are loads of plugins available to do this, but why use a plugin when its only a few lines of code? Continue reading “WordPress Opengraph and Microdata Generation without a plugin”

Neil Anthony Kitchens

Neil Anthony approached me in May of 2010, their brief was simple, create a site that reflected the class and high quality kitchens they designed and installed, make the site clear, crisp, informative, easy to navigate and most importnatly easy to update by the client. Iachieved all of these goals and the staff at NA who weren’t particulalry PC literate regularly updat etheir site to reflect new product and special offers.

PHP Header Redirects

There’s a few ways to redirect a page in PHP. Well, two. A right and a wrong.

Wrong Way

header('Location: foo.php ');

Right way

header('HTTP/1.0 302 Found');
header('Location: foo.php ');
exit;

This is evident on IIS6 and IIS7 where the wrong redirect will just fail.

Even if you are not using IIS6 or IIS7 its good practice to set the headers correctly and exit the script.

Getting YouTube thumbnails for HTML

It’s so simple to embed a YouTube video, with thumbnail into your site. Ditch any clever PHP scripts or completed jQuery libraries.

So you have a Youtube video – http://www.youtube.com/watch?v=t4_dZPVg8KI

Take the video ID t4_dZPVg8KI and craft yourself a link to YouTube’s image server;

http://img.youtube.com/vi/t4_dZPVg8KI/1.jpg

You have a choice of 1.jpg or 2.jpg or 3.jpg

How easy is that!