*/ global $post,$canuck_feature_pic_count; $category = esc_html( ( '' === get_post_meta( $post->ID, 'canuck_portfolio_category', true ) ? false : esc_html( get_post_meta( $post->ID, 'canuck_portfolio_category', true ) ) ) ); $display_post_content = ( '' === get_post_meta( $post->ID, 'canuck_metabox_include_post_content', true ) ? false : true ); $display_post_content_title = ( '' === get_post_meta( $post->ID, 'canuck_metabox_include_post_content_title', true ) ? false : true ); $display_image_caption = ( '' === get_post_meta( $post->ID, 'canuck_metabox_include_image_caption', true ) ? false : true ); $display_image_description = ( '' === get_post_meta( $post->ID, 'canuck_metabox_include_image_description', true ) ? false : true ); $include_pinterest_pinit = get_theme_mod( 'canuck_include_pinit' ) ? true : false; $category_id = get_cat_ID( $category ); $args = array( 'category' => $category_id, 'numberposts' => 20, ); $custom_posts = get_posts( $args ); $use_lazyload = get_theme_mod( 'canuck_use_lazyload' ) ? true : false; if ( 0 !== $category_id && $custom_posts ) { $canuck_feature_pic_count = 0; foreach ( $custom_posts as $post ) { // phpcs:ignore setup_postdata( $post ); // Get the switches to exclude a feature image link or customize the link. $link_to_post = ( '' === get_post_meta( $post->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 ) ); $image_url = get_the_post_thumbnail_url( $post->ID, 'canuck_med15' ); $post_title = the_title_attribute( 'echo=0' ); $post_content = get_the_content(); $image_caption = get_post( get_post_thumbnail_id() )->post_excerpt; $image_desc = get_post( get_post_thumbnail_id() )->post_content; if ( has_post_thumbnail() ) { $canuck_feature_pic_count ++; ?>
<?php echo esc_attr( $image_caption ); ?> <?php echo esc_attr( $image_caption ); ?> <?php echo esc_attr( $image_caption ); ?> <?php echo esc_attr( $image_caption ); ?>
' . esc_attr__( 'Pinterest share image', 'canuck' ) . ''; // phpcs:ignore } if ( false !== $custom_feature_link ) { echo ''; } elseif ( true === $link_to_post ) { echo ''; } echo ''; ?>