';
}
}
/**
* Generates semantic classes for BODY element.
* Sandbox's version was removed from 1.4 onwards.
*/
function arras_body_class() {
if ( function_exists('body_class') ) {
return body_class( array('layout-' . arras_get_option('layout'), 'style-' . arras_get_option('style'), 'no-js') );
}
}
function arras_get_thumbnail($size = 'thumbnail', $id = NULL) {
global $post;
if ($post) $id = $post->ID;
// get post thumbnail (WordPress 2.9)
if (function_exists('has_post_thumbnail')) {
if (has_post_thumbnail($id)) {
return get_the_post_thumbnail($id, $size);
}
}
// go back to legacy (phpThumb or timThumb)
$thumbnail = get_post_meta($id, ARRAS_POST_THUMBNAIL, true);
if ($thumbnail != '') {
switch($size) {
case 'sidebar-thumb':
$sidebar_thumb_size = arras_get_sidebar_thumb_size();
$w = $sidebar_thumb_size[0];
$h = $sidebar_thumb_size[1];
break;
case 'featured-slideshow-thumb':
$slideshow_thumb_size = arras_get_slideshow_thumb_size();
$w = $slideshow_thumb_size[0];
$h = $slideshow_thumb_size[1];
break;
case 'featured-post-thumb':
$w = arras_get_option('featured_thumb_w');
$h = arras_get_option('featured_thumb_h');
break;
case 'news-post-thumb':
$w = arras_get_option('news_thumb_w');
$h = arras_get_option('news_thumb_h');
break;
case 'archive-post-thumb':
$w = arras_get_option('news_thumb_w');
$h = arras_get_option('news_thumb_h');
break;
default:
$w = get_option('thumbnail_size_w');
$h = get_option('thumbnail_size_h');
}
return '';
}
return '
';
}
function arras_render_posts($args = null, $display_type = 'default', $page_type = 'news') {
global $post, $wp_query, $arras_tapestries;
if (!$args) {
$query = $wp_query;
} else {
$query = new WP_Query($args);
}
if ($query->have_posts()) {
call_user_func_array( $arras_tapestries[$display_type]['callback'], array($query, $page_type) );
}
wp_reset_query();
}
function arras_list_trackbacks($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
?>