From 9ba19fd4d0c404418b63c2957c627828f5d44849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20H=C3=B6reth?= Date: Mon, 7 Sep 2015 23:12:13 +0200 Subject: [PATCH] Implement #5. --- php/class-frontend.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/php/class-frontend.php b/php/class-frontend.php index cb31707..f0c5e4a 100644 --- a/php/class-frontend.php +++ b/php/class-frontend.php @@ -25,6 +25,7 @@ public function __construct() { add_action( 'wp_enqueue_scripts', array( $this, 'enqueue' ) ); add_filter( 'post_thumbnail_html', array( $this, 'filter_post_thumbnail' ), 99, 5 ); + add_filter( 'genesis_pre_get_image', array( $this, 'genesis_filter_image' ), 10, 2 ); add_filter( 'post_class', array( $this, 'has_post_video_class' ) ); add_shortcode( 'featured-video-plus', array( $this, 'shortcode' ) ); @@ -190,6 +191,21 @@ public function filter_post_thumbnail( } + public function genesis_filter_image( $output, $args ) { + if( 'html' === $args['format'] && 'achive' === $args['context'] ) { + return $this->filter_post_thumbnail( + $output, + $args['post_id'], + null, + $args['size'], + null + ); + } else { + return $output; + } + } + + /** * Add a 'has-post-video' class to posts if appropriate. *