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

cd_title_filter

This filter affects the vehicle title on the random vehicle widget, the vehicle SRPs (search result pages) and the VDPs (vehicle display pages).

$car_title = apply_filters( ‘cd_title_filter’, $car_title, $post_id );

Example usage:

add_filter( 'cd_title_filter', 'my_cd_title_filter', 10, 2);
function my_cd_title_filter( $car_title, $post_id ) {

    $car_title = '<h3>' . $car_title . '</h3>';
    return $car_title;
}

The above example will wrap the vehicle title in <h3> tags.

The $post_id for the vehicle is provided, which can be used to look up additional information on the vehicle to further adjust the title as needed.

Was this article helpful to you? Yes No

How can we help?