1. Home
  2. Car Demon Code Docs
  3. Display Filters
  4. cd_photo_filter

cd_photo_filter

This filter can be used to modify the photo section on the VDPs (Vehicle Description Pages).

apply_filters( ‘cd_photo_filter’, $html, $post_id, $details, $condition, $type );

Parameters

$html = the current photo html.
$post_id = the post id for the current video
$details = the details section from the current vehicle
$condition = the current vehicle condition, ie. new, preowned, certified, etc.
$type = ‘desktop’ or ‘mobile’

add_filter( 'cd_photo_filter', 'my_photos', 10, 5 );
function my_photos( $html, $post_id, $details, $condition, $type ) {

    $html = '<div class="my_class">' . $html . '</div>';

    return $html;
}

The above example will wrap the current photo area content in a <div> tag with a CSS class of “my_class”.

Was this article helpful to you? Yes No

How can we help?