Enqueue scripts all over but not in single.php

I need to insert this script in the footer on the home, in categories, in pages, in the tags in the search but NOT in single.php:

function live_search() {
    wp_enqueue_script('live_search', get_bloginfo('stylesheet_directory') .'/assets/js/live.search.js', array('jquery'), '1.0.1', true );
    wp_localize_script( 
        'live_search', 
        'MovieWordpressSearch', 
        array( 
            'api' = moviewp_url_search(),
            'nonce' = moviewp_create_nonce('moviewp-search-nonce'),
            'area' = .live-search,
            'more' = Show all,
            ) 
        );
}
add_action('wp_enqueue_scripts', 'live_search');

Can someone help me? Thanks.

Topic wp-localize-script wp-enqueue-script Wordpress javascript

Category Web


with is_singular()

if (!is_singular('post')) {
    function live_search() {
        wp_enqueue_script('live_search', get_bloginfo('stylesheet_directory') .'/assets/js/live.search.js', array('jquery'), '1.0.1', true );
        wp_localize_script( 
            'live_search', 
            'MovieWordpressSearch', 
            array( 
                'api' => moviewp_url_search(),
                'nonce' => moviewp_create_nonce('moviewp-search-nonce'),
                'area' => ".live-search",
                'more' => "Show all",
                ) 
            );
    }
    add_action('wp_enqueue_scripts', 'live_search');
}

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.