Archive for the ‘Work’ Category

Meta descriptions and keywords for each page and post in Wordpress

Friday, April 3rd, 2009

After searching for a plugin that might accommodate this in Wordpress and coming up empty, I went digging for a possible easy way to do this with the means available.   Logic dictates that with custom fields this should be rather easy to accomplish.

The only snag might have been that in retreiving a custom field for a page or a post you need the page or post’s ID.   Usually this id is readily available within “the loop”, but what about when we’re up in the <head> tags?    A little searching in the codex reveals that we can grab your pages’ ID with $wp_query->post->ID.  Fantastic – because, with that we’re pretty much done! Adding the following in your theme’s header.php file between <head> … </head> :

<meta name=”keywords” content=”<?php $key=”meta_keywords”; echo get_post_meta($wp_query->post->ID, $key, true); ?>” />
<meta name=”description” content=”<?php $key=”meta_description”; echo get_post_meta($wp_query->post->ID, $key, true); ?>” />

.. and “meta_keywords” and “meta_description” as custom fields with your desired content for each will get you to where you want to be.

Tags: , , , ,
Posted in Web Development, Work | 1 Comment »

Wordpress hosted on XO Communications.

Friday, March 27th, 2009

Suffice it to say – it’s not a winning combination.   There are two definitive hacks you’ll need to get things to work.

First, a plugin to disable canonical URL redirection.  Second, a hack to wp-settings.php that circumvents the XO php configuration’s not having $_SERVER['REQUEST_URI'].

Update: the second hack will break the non-admin part of the site in the context of the current site I’ve been working on.  So your mileage may vary.

Tags: , , , ,
Posted in Web Development, Work | No Comments »

Installing libmemcached and the memcached gem on Leopard

Monday, February 16th, 2009

facepalmWhat a huge pain in the ass.I just spent hours trying to get every combination of these two to work together and nothing worked.   A handful of versions of libmemcached had no problems installing – .24, .25 and .26 were all easy to install, both from source and from macports.  However, getting the memcached gem to install proved to be way way more difficult.I tried with a myriad of options – the most promising piece of information looked to be from this gentleman’s website – but also proved fruitless.The final solution, after a LOT of googling and clicking around the rubygem forums – this post at Evan Weaver’s blog.  The libmemcached-0.25.14.tar.gz and memcached-0.13.gem tarball and gem, respectively, installed easily without any problems.  After downloading all I had to run was:

tar -xzvf libmemcached-0.25.14.tar.gz
cd libmemcached-0.25.14
./configure && make && sudo make install
cd ..
sudo gem install memcached --no-rdoc --no-ri

Done.Finally.Update:  There seems to be a few issues with the gem I link to being installed correctly in Snow Leopard.  After spending too much time trying to figure out why the gem wouldn’t install, I installed the current memcached gem (from gemcutter) on a whim – and it compiled, and worked, without a problem instantly.   So, if you’re running Snow Leopard and looking to install the memcached gem, try out the latest version first.One caveat – I’m still using the memcached server I linked to above, version  0.25.14, still from Evan Weaver’s site

Tags: , , , , ,
Posted in Web Development, Whining, Work | 2 Comments »

« Older Entries |