A web developer's blog. PHP, MySQL, CakePHP, Zend Framework, Wordpress, Code Igniter, Django, Python, CSS, Javascript, jQuery, Knockout.js, and other web development topics.

Author Archives: Wenbert Del Rosario

WordPress: Get post thumbnail of Featured Image

Note: I’m posting this for myself so that I can refer to it in the future. $cat_id =get_cat_id(’Uncategorized’); $query = new WP_Query(’cat=’.$cat_id.’&year=’.$year.’&monthnum=’.$month.’&day=’.$day); $image = false; while ( $query->have_posts() ) { $query->the_post(); the_title(); $image = wp_get_attachment_image_src(get_post_thumbnail_id($query->ID)); echo ‘<a href="’.$image[0].’">’; } More … Continue reading

Posted in Uncategorized | Leave a comment

Responsive Barebones (Skeletal) WordPress Theme

Using Skeleton (http://www.getskeleton.com), I managed to come up with a “minimized” WordPress theme. What is Skeleton? Skeleton is a small collection of CSS & JS files that can help you rapidly develop sites that look beautiful at any size, be … Continue reading

Posted in Uncategorized | Leave a comment

jQuery: Generic Image Swap

Found this little gem in Stackoverflow. $(function() { $("img") .mouseover(function() { var src = $(this).attr("src").match(/[^.]+/) + "over.gif"; $(this).attr("src", src); }) .mouseout(function() { var src = $(this).attr("src").replace("over", ""); $(this).attr("src", src); }); }); Thanks to Jarrod Dixon. Here is another simpler version. … Continue reading

Posted in General | 2 Comments

Wordress: Using custom fields as key to sort queries with meta_query and meta_key

The example shows that I sort posts with custom field “Start Date”. I am using ‘meta_query’ to query the custom fields – you can find out more here. $args[’post_type’] = array(’ur_post’, ‘programs_post’, ‘education_post’, ‘blog_post’ ); $args[’meta_key’] = ‘Start Date’; $args[’meta_query’] … Continue reading

Posted in General | Tagged , , , , , | Leave a comment

HN: Better RESTful approach

Someone (bradgessler) in HN made a very good comment in this thread. I’m just going to copy-paste everything. Source. The biggest problem with today’s REST implementations is that they’re essentially a database serialization layer. Consider how a RESTful Rails model … Continue reading

Posted in General | Tagged , | 2 Comments

New blog theme

Okay, I just spent a few days coming up with new look for the blog. It is based on the WordPress + Blueprint Barebones/Skeletal (or whatever you call it) theme. This is still a work in progress and if you … Continue reading

Posted in General | Leave a comment

WordPress: Multi-language translation for your theme

Although, there are more advanced multi-language plugins like qTranslate available, this post will deal with basic translations in your theme. Like for example, if you want to translate a “hard-coded” English strings in your theme. <h1>Programs</h1> … translated into French, … Continue reading

Posted in General | Tagged , , , | Leave a comment

CSS: Simple cross-browser DIV shadows

I am posting this for myself and for my brother, John (haha). <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> </head> <body> <style type="text/css"> .Example_F { -moz-box-shadow: 0 0 5px 5px #888; -webkit-box-shadow: 0 0 … Continue reading

Posted in General | Tagged , | 1 Comment

WordPress BlueprintCSS Skeletal/Bare-bones/Blank Slate Theme

It has become my habit that when designing a website, I always use the template that comes with the BlueprintCSS download. I always make sure that my design “fits” BlueprintCSS. I am sharing my WordPress-BlueprintCSS Skeletal Theme. The theme is … Continue reading

Posted in General | 2 Comments

WordPress Template Hierarchy

For my personal consumption.

Posted in General | Leave a comment