Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'vcex_blog_grid_media', function( $output, $atts ) {
- if ( isset( $atts[ 'classes' ] ) && 'mycustom-classname' == $atts['classes'] ) {
- if ( $secondary = get_post_meta( get_the_ID(), 'wpex_secondary_thumbnail', true ) ) {
- $secondary_image = wpex_get_post_thumbnail( array(
- 'attachment' => $secondary,
- 'size' => isset( $atts['img_size'] ) ? $atts['img_size'] : '',
- 'width' => isset( $atts['img_width'] ) ? $atts['img_width'] : '',
- 'height' => isset( $atts['img_height'] ) ? $atts['img_height'] : '',
- 'crop' => isset( $atts['img_crop'] ) ? $atts['img_crop'] : '',
- 'class' => 'vcex-blog-entry-img',
- 'apply_filters' => 'vcex_blog_grid_thumbnail_args',
- 'filter_arg1' => $atts,
- ) );
- return '<div class="vcex-blog-entry-media entry-media"><a href="' . esc_url( get_permalink() ) . '" title="' . esc_attr( get_the_title() ) . '">'. $secondary_image . '</a></div>'; // override media with first image
- }
- }
- return $output;
- }, 10, 2 );
Add Comment
Please, Sign In to add comment