*/
global $post, $canuck_feature_option, $canuck_feature_category;
$canuck_flex_effect = sanitize_text_field( get_theme_mod( 'canuck_flex_slider_effect', 'fade' ) );
$canuck_flex_pause = sanitize_text_field( get_theme_mod( 'canuck_flex_slider_pause', '5000' ) );
$canuck_flex_trans = sanitize_text_field( get_theme_mod( 'canuck_flex_slider_trans', '600' ) );
$canuck_flex_auto = intval( get_theme_mod( 'canuck_flex_slider_auto', 1 ) );
$category_id = get_cat_ID( $canuck_feature_category );
$args = array(
'category' => $category_id,
'numberposts' => 20,
);
$custom_posts = get_posts( $args );
if ( 0 !== $category_id && $custom_posts ) {
?>
ID, 'canuck_metabox_link_to_post', true ) ? false : true );
$custom_feature_link = ( '' === get_post_meta( $post->ID, 'canuck_custom_feature_link', true ) ? false : get_post_meta( $post->ID, 'canuck_custom_feature_link', true ) );
$include_feature_title = ( '' === get_post_meta( $post->ID, 'canuck_metabox_include_feature_title', true ) ? false : true );
if ( has_post_thumbnail() ) {
$canuck_feature_pic_count ++;
?>
-
ID, 'full' );
$image_url_large = get_the_post_thumbnail_url( $post->ID, 'large' );
$image_url_medium_large = get_the_post_thumbnail_url( $post->ID, 'medium_large' );
$image_url_medium = get_the_post_thumbnail_url( $post->ID, 'medium' );
$srcset = esc_url( $image_url_medium ) . ' 300w, ' . esc_url( $image_url_medium_large ) . ' 768w, ' . esc_url( $image_url_large ) . ' 1024w, ' . esc_url( $image_url ) . ' 1500w';
$canuck_feature_title = ( false === $include_feature_title ? get_post( get_post_thumbnail_id() )->post_excerpt : the_title_attribute( 'echo=0' ) );
if ( '' === $canuck_feature_title ) {
$imagetitle = '';
$imagealt = esc_html__( 'flexslider image', 'canuck' );
} else {
$imagetitle = $canuck_feature_title;
$imagealt = $canuck_feature_title;
}
// Set up the link and image.
if ( true === $link_to_post ) {
?>
' . wp_kses_post( $canuck_feature_title ) . '';
}
}
?>