'.$license['title'].' license; additional terms may apply.';
}
function awe_video_url(){
if ( get_option('permalink_structure') != '' ) {
return get_home_url().'/video/';
} else {
return get_home_url().'?post_type=video';
}
}
function awe_door_video_menu() {
global $wp_query;
$post_type = isset( $wp_query->post->post_type ) ? $wp_query->post->post_type : null;
$current = '';
if ( $post_type == 'video' && !is_search() ) {
$current = ' current-menu-item';
}
print '
post_type == 'video' ) {
$image_id = get_post_thumbnail_id( $post->ID );
$poster = wp_get_attachment_image_src( $image_id, 'awevideo-poster' );
$video = AWE_Videos::retrieve($post->ID);
if ( $view == 'summary_topic' || $view == 'summary_video' ) {
if ( is_sticky( $post->ID ) ) {
$sticky_class = ' sticky';
} else {
$sticky_class = '';
}
if ( $count == 9 ) {
$fold = ' awedoor-page-fold';
} else {
$fold = '';
}
print '';
?>
ID );
$poster = wp_get_attachment_image_src( $image_id, 'awevideo-thumbnail' );
print '
';
?>
ID ) ) {
$sticky_class = ' sticky';
} else {
$sticky_class = '';
}
if ( $count == 3 ) {
$fold = ' awedoor-page-fold';
} else {
$fold = '';
}
print '';
$uri = get_permalink( $post->ID );
print '
';
if ( has_post_thumbnail( $post->ID ) ) {
$image_id = get_post_thumbnail_id( $post->ID );
$image = wp_get_attachment_image_src( $image_id, 'awedoor-thumbnail' );
print '
';
}
print get_post_excerpt( $post, 40 );
print '
';
print '
';
print '
Topics:
';
$topics = wp_get_post_terms( $post->ID, 'topic' );
$total = count( $topics );
$topics = array_splice( $topics, 0, 7 );
if ( count( $topics ) > 0 ) {
foreach( $topics as $topic ) {
print '- '.$topic->name.'
';
};
if ( $total > count( $topics ) ) print '- ...
';
print '
';
}
print '
';
print '
';
} else {
wp_enqueue_script( 'video-page', get_template_directory_uri().'/static/video-page.js', array( 'jquery' ) );
?>
:
';
print '';
$cats = get_the_terms( $post->ID, 'topic' );
$total = count( $cats );
$cats = array_splice( $cats, 0, 7 );
if ( count( $cats ) > 0 ) {
print 'Topics:
';
foreach( $cats as $cat ) {
print '- '.$cat->name.'
';
};
if ( $total > count( $cats ) ) print '- ...
';
print '
';
}
if (! comments_open() &&
! is_page() &&
post_type_supports( get_post_type(), 'comments' ) ) {
print '';
} else {
print '';
}
print '';
?>
';
$uri = get_permalink( $post->ID );
print '
';
if ( has_post_thumbnail( $post->ID ) ) {
$image_id = get_post_thumbnail_id( $post->ID );
$image = wp_get_attachment_image_src( $image_id, 'awedoor-thumbnail' );
print '
';
}
print get_post_excerpt( $post, 40 );
if ( !has_post_thumbnail( $post->ID ) ){
$image_posts = &get_children( array(
'post_parent' => $post->ID,
'post_type' => 'attachment',
'post_mime_type' => 'image'
)
);
if ( !empty( $image_posts ) ) {
foreach ( $image_posts as $attachment_id => $attachment ) {
$image = wp_get_attachment_image_src( $attachment_id, 'awedoor-thumbnail' );
$url = get_permalink( $attachment_id );
print '
';
}
}
}
print '
';
print '
';
print '
';
$cats = get_the_category( $post->ID );
$total = count( $cats );
$cats = array_splice( $cats, 0, 7 );
if ( count( $cats ) > 0 ) {
print 'Categories:
';
foreach( $cats as $cat ) {
print '- '.$cat->name.'
';
};
if ( $total > count( $cats ) ) print '- ...
';
print '
';
}
$tags = wp_get_post_tags( $post->ID );
$total = count( $tags );
$tags = array_splice( $tags, 0, 7 );
if ( count( $tags ) > 0 ) {
print '
Tags:
';
foreach( $tags as $tag ) {
print '- '.$tag->name.'
';
};
if ( $total > count( $tags ) ) print '- ...
';
print '
';
}
if (! comments_open() &&
! is_page() &&
post_type_supports( get_post_type(), 'comments' ) ) {
print '';
} else {
print '';
}
print '
';
print '
';
} else if ( $view == 'full' ) {
$uri = get_permalink( $post->ID );
$date = get_the_date();
print '';
print ''.$date.' : '.apply_filters( 'the_title', $post->post_title ).'
';
$author = get_userdata( $post->post_author );
print '';
print '';
the_content();
//.apply_filters( 'the_content', $post->post_content ).'';
print '
';
wp_link_pages( array( 'before' => '
' . __( 'Pages:', 'twentyeleven' ) . '', 'after' => '
' ) );
print '
';
print '
';
print '';
print '
Categories:
';
$cats = get_the_category( $post->ID );
if ( count( $cats ) > 0 ) {
foreach( $cats as $cat ) {
print '- '.$cat->name.'
';
};
print '
';
}
$tags_list = get_the_tag_list(); //theme-check won't pass without this
$tags = wp_get_post_tags( $post->ID );
if ( count( $tags ) > 0 ) {
print '
Tags:
';
foreach( $tags as $tag ) {
print '- '.$tag->name.'
';
};
print '
';
}
if (! comments_open() &&
! is_page() &&
post_type_supports( get_post_type(), 'comments' ) ) {
print '';
} else {
?>
' . get_the_title() . '' );
?>
';
print '
';
print '
';
$prev = get_next_post();
if ( $prev != null ) {
print '
';
print '
Previous
';
$url = get_permalink( $prev->ID );
print '
'.apply_filters( 'the_title', $prev->post_title ).'';
print '
';
print get_post_excerpt( $prev, 40 );
print '
';
print '
';
print '
';
}
$next = get_previous_post();
if ( $next != null ) {
print '
';
print '
Next
';
$url = get_permalink( $next->ID );
print '
'.apply_filters('the_title', $next->post_title ).'';
print '
';
print get_post_excerpt( $next, 40 );
print '
';
print '
';
print '
';
}
print '
';
print '
';
print '';
}
} else if ( $post->post_type == 'page' ) {
if ( $view == 'summary' ) {
if ( is_sticky( $post->ID ) ) {
$sticky_class = ' sticky';
} else {
$sticky_class = '';
}
print '
';
$uri = get_permalink( $post->ID );
print '
';
print get_post_excerpt( $post, 40 );
print '
';
}
} else if ( $post->post_type == 'attachment' ) {
print '
';
if ( strpos( $post->post_mime_type, 'image' ) >= 0 ) {
print ''.get_the_date().' ';
if ( $post->post_title ) {
print ' : '.$post->post_title;
}
print '
'; // title
$author = get_userdata( $post->post_author ); // author id
print '';
$image_src = wp_get_attachment_image_src( $post->ID, 'awedoor-body' );
$img_alt = get_post_meta( $post->ID, '_wp_attachment_image_alt', true); //alt
if ($img_alt == '') {
$img_alt = $post->post_title;
}
print '';
print ''.$post->post_excerpt.'
'; // caption
print '';
print '
'.$post->post_content.'
'; // description
print '
';
print '
Image Sizes
';
//$image_sizes = get_intermediate_image_sizes();
$image_sizes = array('thumbnail','medium','large', 'original');
print '
';
print ''.__('Width').' | '.__('Height').' | '.__('Title').' |
';
foreach ( $image_sizes as $image_size ) {
$image_src = wp_get_attachment_image_src( $post->ID, $image_size );
print ''.$image_src[1].' | '.$image_src[2].' | '.$image_size.' | '.__('View', 'awedoor').' |
';
}
print '
';
print '
';
print '
';
print '
Navigation
';
$attachments = array_values( get_children( array(
'post_parent' => $post->post_parent,
'post_status' => 'inherit',
'post_type' => 'attachment',
'post_mime_type' => 'image',
'order' => 'ASC',
'orderby' => 'menu_order ID'
)));
foreach ( $attachments as $k => $attachment ) {
if ( $attachment->ID == $post->ID ) {
break;
}
}
$prev = $k - 1;
$next = $k + 1;
if ( isset($attachments[$prev]) ) {
$img = wp_get_attachment_image_src( $attachments[$prev]->ID, 'awedoor-thumbnail' );
$url = get_attachment_link( $attachments[$prev]->ID );
print '
';
}
if ( isset($attachments[$next]) ) {
$img = wp_get_attachment_image_src( $attachments[$next]->ID, 'awedoor-thumbnail' );
$url = get_attachment_link( $attachments[$next]->ID );
print '
';
}
print '
';
print '
';
print '
';
} else {
print ''.wp_get_attachment_url( $post->ID ).'';
}
print '';
}
}
function get_post_excerpt($item, $excerpt_length=55, $excerpt_more='...') {
$text = $item->post_excerpt;
$raw_excerpt = $text;
if ( '' == $text ) {
$text = $item->post_content;
$text = strip_shortcodes($text);
$text = apply_filters('the_content', $text);
$text = str_replace(']]>', ']]>', $text);
$text = strip_tags($text);
$words = preg_split("/[\n\r\t ]+/", $text, $excerpt_length + 1, PREG_SPLIT_NO_EMPTY);
if ( count($words) > $excerpt_length ) {
array_pop($words);
$text = implode(' ', $words);
$text = $text . $excerpt_more;
} else {
$text = implode(' ', $words);
}
}
$text = apply_filters('get_the_excerpt', $text);
$text = apply_filters('the_excerpt', $text);
return $text;
}
if ( ! function_exists( 'awedoor_comment' ) ) :
/**
* Template for comments and pingbacks.
*
* To override this walker in a child theme without modifying the comments template
* simply create your own awedoor_comment(), and that function will be used instead.
*
* Used as a callback by wp_list_comments() for displaying the comments.
*
* @since AWE Door 0.1
*/
function awedoor_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case 'pingback' :
case 'trackback' :
?>
∞
id="li-comment-">