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

cd_nav_filter

This filter can be used to modify the page navigation that displays before and after the vehicle search results.

apply_filters( ‘cd_nav_filter’, $nav, $position, $search_query );

$nav = The current navigation html.
$position = top or bottom to denote the position of the navigation element.
$search_query = The current vehicle search query

add_filter( 'cd_nav_filter', 'my_nav', 10, 3 );
function my_nav( $nav, $position, $search_query ) {

    if ( 'top' === $position ) {
        $nav = '<div class="on_top">' . $nav . '</div>';
    }

    return $nav;
}

The above example checks to see if the $position is ‘top’ and if it is then it wraps the navigation in a <div> tag with a class of “on_top”.

Was this article helpful to you? Yes No

How can we help?