Should I use get_bloginfo(‘stylesheet_directory’) or get_stylesheet_directory_uri() when enqueueing my js files?

Starting from WordPress 4.7, I would use get_theme_file_uri(), so any child theme can override the file easily: if the file exists in the child theme, get_theme_file_uri() returns the URI to that file, otherwise returns the file in the parent theme: wp_enqueue_script( ‘localScroll’, get_theme_file_uri( ‘js/jquery.localScroll.min.js’ ), array( ‘scrollTo’ ), ‘1.2.8b’, true ); If you want to … Read more

Where to insert Google Maps API code in functions.php

Your API key is URL encoded as a GET variable like so: wp_enqueue_script( ‘google_js’, ‘https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&key=yourKeyHere’, ”, ” ); I don’t urlencode the handle. The function/class does that. So if you’re having problems getting the script to load, don’t urlencode the handle.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)