wpbdp_thumbnail_html

Heads up!
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.

This hook can be used to filter the listing main thumbnail HTML.

Usage

add_filter( 'wpbdp_thumbnail_html', 'bd_add_class_to_thumbnail' );

Parameters

  • $image_html (string) The listing thumbnail HTML

Examples

Add class

This example will add a class attribute to listing main thumbnail

add_filter( 'wpbdp_thumbnail_html', 'bd_add_class_to_thumbnail' );
function bd_add_class_to_thumbnail( $html ) {
    $css_class = 'new-class ';
    $html = str_replace( 'class="', 'class="' . $css_class, $html );
    return $html;
}

Change Log

Added in version 5.9

Related Articles

Need Support?

Can't find the answer you're looking for?
Contact Support