How to remove “Proudly powered by WordPress” in Twenty Sixteen (2016) theme?

The quick and dirty way would be to either delete the two lines that are ‘resposible’ for the message, or wrap them by comments / comment-them-out. In your theme folder ‘twentysixteen’ look for the theme file ‘footer.php’ Around line 50 look for the following two lines: <span class=”site-title”><a href=”https://wordpress.stackexchange.com/questions/230348/<?php echo esc_url( home_url(“https://wordpress.stackexchange.com/” ) ); ?>” … Read more

How to add JS in footer

By Using wp_enqueue_script() You can add your scripts to a JS file and then enqueue it properly. I assume you have added your scripts to file.js. Here’s how you enqueue it in the footer: add_action(‘wp_enqueue_scripts’,’my_script_callback’); function my_script_callback(){ wp_enqueue_script( ‘my-script’, get_template_directory_uri().’/folder/file.js’, array(jquery), null, true ); } The last argument in wp_enqueue_script() determines whether your script should … Read more

wp_enqueue script my_javascript_file in the footer

You have true set in the 4th parameter (version), not the 5th. wp_enqueue_script( ‘my_javascript_file’, //slug get_template_directory_uri() . ‘/javascripts/app.js’, //path array(‘jquery’), //dependencies false, //version true //footer ); Also, as someone else mentioned, drop jquery enqueue, you’ve got it as a dependency, you don’t need to enqueue it as well. One last thing, your function name has … Read more

How to add code to just before closing body tag

If you’re just using a small script or other markup, you can hook a function to the wp_footer filter, which should be included in all properly-coded themes: add_action( ‘wp_footer’, function () { ?> <script language=”javascript” type=”text/javascript”> startcart() </script> <?php } ); However, if your JavaScript code is more substantial, or you wish to use built-in … Read more

Auto get_header and get_footer on every template?

Looking at wp-includes/template-loader.php … there seems to be a way: if ( $template = apply_filters( ‘template_include’, $template ) ) include( $template ); You could hook into that filter, handle the including in a callback function and return FALSE. Sample code, not tested: add_filter( ‘template_include’, function( $template ) { get_header(); include $template; get_footer(); return FALSE; });

How to add javascript just before the closing body tag in the footer of WordPress

You should always add javascript (and styles) with the WordPress function wp_enqueue_script() Works like this: wp_enqueue_script( $handle // the name of your enqueued file, in your case ‘myscript’ ,$src // source of your file, can be external, or for your example: get_bloginfo(‘template_directory’) . ‘/js/scripts.js’ ,$deps // does your javascript depend on another javascriptfile? for example … Read more