Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the community forum?
All Topics
p.couret

Add link on featured image

Hi,
I would like to know how could i display the full image when clicking on the featured image thumb column please ?
adding a href to the image in a blank window ?
thanks

1 week, 6 days ago
Stefan
Developer

Hi,

You can use the following snippet to make the image clickable.

/**
 * @param $value  string
 * @param $id     int
 * @param $column AC\Column
 */
function ac_make_feature_image_columns_clickable( $value, $id, $column ) {
	if ( $column instanceof AC\Column\Post\FeaturedImage && $thumbnailid = $column->get_raw_value( $id ) ) {
		$value = sprintf( '<a href="%s" target="_blank">%s</a>', wp_get_attachment_url( $thumbnailid ), $value );
	}
	return $value;
}
add_filter( 'ac/column/value', 'ac_make_feature_image_columns_clickable', 10, 3 );
1 week, 5 days ago
p.couret

Hi Stefan,
It works great , thanks a lot !

1 week, 5 days ago

You must be logged in to reply to this topic.