Add footer.php to WordPress child theme

You have wrong argument for the filter. The first argument of the add_filter is the filter you are hooking up to. In your case it’s the mesmerize_get_footer_copyright. The second argument is the Call back function that would run the filter is called. So change your add_filter to this add_filter(‘mesmerize_get_footer_copyright’, ‘change_copyrightText’, 10,1) ;

enqueuing React script and hooking its target div fails to load script

I had a similar issue within WordPress a few days ago but it doesn’t really have anything to do with WordPress. Simply put, your code is loading the babel-polyfill library twice somehow. Most commonly it can happen if you’re using the library yourself and on top of that a third-party library is including that too. … Read more

Wp_head and wp_footer vs wp_enqueue_script javascript files?

It looks like you’ve overlooked the 5th input parameter of: wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer ); Namely the boolean $in_footer part, that will put the script in the footer, if set as true, else in the header. You can also use $deps to handle dependencies. Check out the Codex for more info. => I … Read more

Add script to footer – on post editor

Hook into ‘admin_footer-post-new.php’ and ‘admin_footer-post.php’, check the global variable $post_type: add_action( ‘admin_footer-post-new.php’, ‘wpse_73692_script’ ); add_action( ‘admin_footer-post.php’, ‘wpse_73692_script’ ); function wpse_73692_script() { if ( ‘post’ !== $GLOBALS[‘post_type’] ) return; ?> <script>alert( ‘<?php echo $GLOBALS[‘post_type’];?>’ );</script> <?php }

How can I remove “Proudly powered by WordPress” from twentyeleven without modifying footer.php?

There are 3 methods. Somewhat weird but since this text is internationalized you can filter the output. This is just an example to remove the text, the link is still present in the source. add_filter(‘gettext’, ‘remove_powered_by’, 20, 3); function remove_powered_by( $translated_text, $untranslated_text, $domain ) { $custom_field_text=”Proudly powered by %s”; if ( !is_admin() && $untranslated_text === … Read more