Enqueueing Script to footer puts it at the very bottom

You want something like this. // assuming you want to load this only on frontend if ( ! is_admin() ) add_action( ‘wp_enqueue_scripts’, ‘wpse_112876_load_scripts’ ); function wpse_112876_load_scripts() { wp_enqueue_script( ‘my_foundation’, get_template_directory_uri() . ‘/js/foundation.min.js’, null, ‘4.3.3’, true ); wp_enqueue_script( ‘my_foundation_init’, get_template_directory_uri() . ‘/js/foundation_init.js’, array( ‘my_foundation’ ), null, true ); }

css3-mediaqueries-js failing with child theme

The author of css3-mediaqueries-js states the following via https://github.com/livingston/css3-mediaqueries-js: Note: Doesn’t work on @import’ed stylesheets (which you shouldn’t use anyway for performance reasons). Also won’t listen to the media attribute of the `<link>` and `<style>` elements. style.css via my child theme uses @import to bring across the parent theme stylesheet. To overcome the problem, I … Read more

Generating embed code for users to share

Try following code. This will display embed code in the bottom of the page. <?php add_filter(‘the_content’,’my_custom_embed_code’); function my_custom_embed_code( $content ){ global $post; if ( ‘page’ == $post->post_type ) { $embed_code=””; $page_url = esc_url( get_permalink($post->ID ) ) ; $embed_code .= ‘<object data=”https://wordpress.stackexchange.com/questions/160604/.$page_url.” width=”100%” height=”500″><embed src=”https://wordpress.stackexchange.com/questions/160604/.$page_url.” width=”100%” height=”500″></embed> Error: Embedded data could not be displayed. Visit <a … Read more

Loop through arguments of a function

wp_enqueue_script states the parameters type respectively as string – string – array – string – boolean. As you pass an array as the second parameter, the error occurs. Now, comparing your $array data, you can handle it extracting the array or using array key/value. – public function loadScripts() { $themeScripts = iarray( ‘custom’ => array( … Read more

How to include a JS file in this theme?

From wp_enqueue_scripts action: wp_enqueue_scripts is the proper hook to use when enqueuing items that are meant to appear on the front end. For admin-facing scripts, the correct action hook is admin_enqueue_scripts function prefix_enqueue_scripts3() { wp_enqueue_script( ‘metabox_js’, get_stylesheet_directory_uri() . ‘/js/metabox.js’, array( ‘jquery’ ), ‘1.0.0’, true ); } add_action( ‘admin_enqueue_scripts’, ‘prefix_enqueue_scripts3’ );

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