RSS Feeds

thinkclay

An introduction to Clay McIlrath Welcome to my blog / portfolio site and thanks for stopping in. I’ve set up on this corner of the web, because I really believe that it’s important for people to share knowledge, skills, and creativity freely. I personally enjoy the process of learning, exploring, and doing all things creative and cutting edge as well as sharing those experiences with others. I have a passion for meeting new trends and developing highly functional yet uniquely creative, websites and applications. I am a managing partner of two companies that build businesses both online and off. My businesses use the talents of many different individuals creating a unique and powerful force when put together on a project. However, my individual strengths are in corporate identity, graphic design, front-end web development, and CMS integration with Content Management Systems such as Modx, Magento, Wordpress, and others.

Homepage: http://thinkclay.com

Jabber/GTalk: clay.mcilrath@gmail.com

AIM: claymcilrath


Posts by thinkclay

Automatically Get Images on Post Content

November 20, 2009 - 7:32 pm

Tags: ,
Posted in Wordpress Images | No comments

The problem. Using custom fields to display images associated with your post is definitely a great idea, but many WordPress users would like a solution for retrieving images embedded in the post’s content itself.
The solution. As far as we know, there’s no plug-in to do that. Happily, the following loop will do the job: it [...]

Display Random Images from Media Gallery

November 8, 2009 - 12:01 am

Tags:
Posted in Wordpress Hack | No comments

<?php
$args = array(
‘post_type’ => ‘attachment’,
‘numberposts’ => -1,
‘post_status’ => null,
‘post_parent’ => $post->ID,
‘orderby’ => ‘rand’
);
$attachments = get_posts($args);
$noimages = count($attachments);
 
if ($attachments) {
 
foreach ($attachments as $attachment) {
$alttxt = $attachment->post_title;
$imgid = $attachment->ID;
$fileurl = $attachment->guid;
 
$meta = wp_get_attachment_metadata($imgid);
$imgw = $meta[’sizes’][’thumbnail’][’width’];
$imgh = $meta[’sizes’][’thumbnail’][’height’];
 
$imgext = substr($fileurl, -4);
$fileurl = substr($fileurl, 0, -4);
$fileurl = $fileurl."-".$imgw."x".$imgh.$imgext;
 
// construct the image
echo "<img src=’".$fileurl."’ alt=’".$alttxt."’ class=’alignleft highlightimg’ />";
break;
}
}
the_excerpt(”);
?>

Dynamic Title in Wordpress

November 6, 2009 - 9:30 pm

Tags: ,
Posted in Wordpress SEO | No comments

If you’re not interested in changing your title tags on a post-to-post basis, then this is a good solution to show relevant titles to the page that the user is on.

<title>
<?php
if (is_home()) {
echo bloginfo(’name’);
} elseif (is_404()) {
echo ‘404 Not Found’;
} elseif (is_category()) {
echo ‘Category:’; wp_title(”);
} elseif (is_search()) {
echo ‘Search Results’;
} elseif ( is_day() || is_month() [...]