Loading scripts to the Post Edit page only

We can improve a little bit with : function specific_enqueue($hook_suffix) { if( ‘post.php’ == $hook_suffix || ‘post-new.php’ == $hook_suffix ) { wp_enqueue_script( ‘custom_js’, get_template_directory_uri() . ‘/inc/meta/custom.js’, array( ‘jquery’ )); wp_enqueue_style( ‘custom_css’, get_template_directory_uri() . ‘/inc/meta/custom.css’) } } add_action( ‘admin_enqueue_scripts’, ‘specific_enqueue’ );

Using multiple versions of jQuery while still calling it like WP likes

I found that it was better for me to use the latest jQuery version (which WordPress loads by default) and to treat the incompatibility issue by modifying the JS plugin files that were incompatible with the latest jQuery version. Note: The reason I chose this solution is because in most cases, JS plugin incompatibility with … Read more

Enque Typekit Fonts – Not Found

As mentioned in the comments, your code snippet is working fine. Nevertheless the font kit has to be published within the Kit Editor: Login to your Typekit account Locate the Kit Editor (see: https://typekit.com/kit_editor/kits/xxxxxxx) Click the Publish button (bottom right) You may also consider using the new embed code provided by Typekit: <script>try{Typekit.load({ async: true … Read more

Can’t move jQuery to footer

Not the best way but removing the default WordPress actions that allow any scripts in the document’s head can help: function md_footer_enqueue_scripts() { remove_action(‘wp_head’, ‘wp_print_scripts’); remove_action(‘wp_head’, ‘wp_print_head_scripts’, 9); remove_action(‘wp_head’, ‘wp_enqueue_scripts’, 1); } add_action(‘wp_enqueue_scripts’, ‘md_footer_enqueue_scripts’);`

enqueue hover function

You can add your JS to a file in your child theme /js/example.js, then enqueue it like this: //add_action( ‘wp_enqueue_scripts’, ‘wpdocs_theme_name_scripts’ ); function wpdocs_theme_name_scripts() { wp_enqueue_script( ‘script-name’, get_stylesheet_directory_uri() . ‘/js/example.js’, [], ‘1.0.0’, true ); } Alternatively, you can add the styles inline using this: add_action( ‘wp_enqueue_scripts’, ‘wpse_home_game’, 20 ); function wpse_home_game() { wp_register_script( ‘home-game’, false … Read more

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