Home Blog Portfolio Development Contact Us Recommends
Building One Application at a Time

Archive for the ‘HTML’ Category

WordPress Multiple Post Thumbnails

Wednesday, September 29th, 2010

Found a real nice plug-in for WordPress which helps support a secondary featured image for your posts, pages or custom posts.  You can find it here:

http://wordpress.org/extend/plugins/multiple-post-thumbnails/

Couple things to note:

  1. The site does not state where to add this code… add it to the bottom of your functions.php file in your theme.
  2. The code to add states you need a $thumb = new …  omit the “$thumb =” part.
  3. The rest of the instructions are clear and accurate.

Enjoy!

Get Term by Post Slug WordPress

Wednesday, September 22nd, 2010

Here is an example anyone can add in their functions.php file or plugins to get WordPress terms or taxonomies by the post slug.  Hope this helps some people out.

/**
* Get taxonomy from a post slug
*/
function get_term_by_post_slug($post_slug, $output = OBJECT)
{
global $wpdb;

$strsql = “SELECT wp_terms.name “;
$strsql .= “FROM wp_terms “;
$strsql .= “JOIN wp_term_taxonomy USING(term_id) “;
$strsql .= “JOIN wp_term_relationships ON wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id “;
$strsql .= “JOIN wp_posts ON wp_posts.ID = wp_term_relationships.object_id “;
$strsql .= “WHERE wp_posts.post_name = \”%s\” “;

$post = $wpdb->get_var( $wpdb->prepare( $strsql, $post_slug ));

if ( !empty($post) )
return $post;
return null;
}

Search Box for Custom Post Types in WordPress

Tuesday, September 14th, 2010

This took me hours to figure out, yet is it so simple. This needs to be documented more so I thought I would post about it. Here is the snipet that makes the whole thing work.
(more…)

CRE Loaded/OSCommerce Email When MySQL Error Happens

Thursday, April 15th, 2010

Just in case you ever wanted to know where the email gets sent when a MySQL error happens in CRE Loaded or OSCommerce it is in (more…)