create full image display page with title, desc, tags, etc
I changed my WordPress image display plugin to href
, which uses a slightly enhanced version of to fetch the single image asset post. Here's my version of:function get_posts($args) {
global $wpdb, $tableposts, $tablepost2cat;
parse_str($args, $r);
if (!isset($r['numberposts'])) $r['numberposts'] = 5;
if (!isset($r['offset'])) $r['offset'] = 0;
if (!isset($r['category'])) $r['category'] = ”;
if (!isset($r['orderby'])) $r['orderby'] = ‘date’;
if (isset($r['orderby'])) $r['orderby'] = “post_”.$r['orderby'];
if (!isset($r['order'])) $r['order'] = ‘DESC’;
$now = current_time(’mysql’);
if (isset($r['postid'])) {
$posts = $wpdb->get_results(”SELECT DISTINCT * FROM $tableposts WHERE id = ” . $r['postid'] );
} else {
$posts = $wpdb->get_results(”SELECT DISTINCT * FROM $tableposts LEFT JOIN $tablepost2cat ON ($
tableposts.ID = $tablepost2cat.post_id) WHERE category_id = “. $r['category'] . ” AND post_date < = ‘$now’ AND
(post_status = ‘publish’) GROUP BY $tableposts.ID ORDER BY ” .$r['orderby']. ” “.$r['order'].” LIMIT ” . $r['o
ffset’] . ‘,’ . $r['numberposts']);
}
return $posts;
}
Other blogs commenting on this post –



