• Hi,

    I’ve enqueued scripts and css files in the functions.php file in the Avada child theme and according to Firebug, both scripts and the css file are being loaded but the scripts functions and the styling is not taking affect.

    Here’s the code:

    <?php
    function avada_child_scripts() {
    	if ( ! is_admin() && ! in_array( $GLOBALS['pagenow'], array( 'wp-login.php', 'wp-register.php' ) ) ) {
    		$theme_info = wp_get_theme();
    		wp_enqueue_style( 'avada-child-stylesheet', get_template_directory_uri() . '/style.css', array(), $theme_info->get( 'Version' ) );
    	}
    }
    add_action('wp_enqueue_scripts', 'avada_child_scripts', 'wpb_adding_styles');
    
    // Umut add custom search form shortcode
    function wpbsearchform( $form ) {
    
        $form = '<form role="search" method="get" id="searchform" action="' . home_url( '/' ) . '" >
        <div><label class="screen-reader-text" for="s">' . __('Search for:') . '</label>
        <input type="text" value="' . get_search_query() . '" name="s" id="s" />
        <input type="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" />
        </div>
        </form>';
    
        return $form;
    }
    
    add_shortcode('wpbsearch', 'wpbsearchform');
    // Umut END
    
    // Umut
    
        function umut_nested_navigation() {
    
            wp_enqueue_script('jquery');
    
            wp_register_script('sliding-menu',get_stylesheet_directory_uri().'/js/jquery-sliding-menu.js');
            wp_register_script('nested-navigation',get_stylesheet_directory_uri().'/js/nested-navigation.js');
            wp_register_style('sliding-menu-css',get_stylesheet_directory_uri().'/css/jquery-sliding-menu.css');
    
            wp_enqueue_script('sliding-menu');
            wp_enqueue_script('nested-navigation');
            wp_enqueue_style( 'sliding-menu-css');
    
        }
    
    add_action( 'wp_enqueue_scripts', 'umut_nested_navigation');
    
        // End Umut
    
    ?>

    Link to the website

    The end product is supposed to look like this nested navigation

    Can anyone point me in the right direction?

    Best regards,
    Umut

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Theme: Avada] Enqueued scripts and css but functions/styling not taking affect’ is closed to new replies.