Car Demon Code Docs

  1. Home
  2. Car Demon Code Docs
  3. Actions
  4. cd_sidebar_action


This action gets called after the vehicle SRPs (Search Result Pages) and can be used, for example, to add a custom sidebar area below or to the side of the vehicles.

do_action( ‘cd_sidebar_action’ );

add_action( 'cd_sidebar_action', 'my_sidebar' );
function my_sidebar() {

 $html = '<div id="vehicle_widget" class="vehicle_widget">';
     $html .= '<ul>';
         if ( ! function_exists( 'dynamic_sidebar') || ! dynamic_sidebar( 'My Sidebar' ) ) :
         $output = ob_get_contents();
         $html .= $output;
     $html .= '</ul>';
     $html .= '<br class="clear_car">';
 $html .= '</div>';
 if ( empty( $output ) ) {
     $html = '';
 echo $html;

The above example will output the contents of the “My Header Sidebar” sidebar area right after the SRP. This example assumes you have already registered the “My Header Sidebar” area. You can learn more about registering your own custom sidebar areas at

Was this article helpful to you? Yes No

How can we help?