Move jQuery to the bottom of the page whilst keeping the WordPress jQuery

You can change it by calling add_data method of $wp_scripts object. This object holds all scripts and information how to render it. To force rendering script in the footer you can do it like this: add_action( ‘wp_enqueue_scripts’, ‘wpse8170_enqueue_scripts’ ); function wpse8170_enqueue_scripts() { $GLOBALS[“wp_scripts”]->add_data( ‘jquery’, ‘group’, 1 ); } P.S.: I haven’t tested it, but suppose … Read more

Use wp_enqueue_scripts from included php file

I found the problem…. I ran main.php like: function run_this(){ include’path/to/other.php’; } add_shortcode(‘shortcode’, ‘run_this’); And most of the content of other.php came up exept the hooks did’nt work then i tried using add_action(‘init’, ‘run_this’); and then it worked…. exept that i get a fatal error that i cant redeclare some functions twice 😀

wp_register_script(… $in_footer = true) not working

Choose the right place in (rendering-)time First off, you are hooking at init, while you want to add your callback on wp_enqueue_script. Example: add_action( ‘wp_enqueue_script’, function() { wp_deregister_script( ‘jquery’ ); // Rest of logic } ); Staying up to date with core Also, you might want to use the correct version that core uses. I know, … Read more

Including files in Child Themes

get_template_directory looks in the parent theme for files. In the case a child theme is being used, the absolute path to the parent theme directory will be returned. Use get_stylesheet_directory() to get the absolute path to the child theme directory. http://codex.wordpress.org/Function_Reference/get_template_directory This file is not meant to be replaced. You will need to find another … Read more