get_sidebar() will not work in footer.php

You need to read the documentation, get_sidebar(): Includes the sidebar template for a theme or if a name is specified then a specialised sidebar will be included. Its purpose is to load sidebar.php. It does not output widgets. To output widgets you need to use dynamic_sidebar(): <?php dynamic_sidebar( ‘sidebar-1’ ); ?> That will output the … Read more

On click load iframe [closed]

Did you inspect your code for any errors? If the error is “Uncaught TypeError: $ is not a function”, then maybe you can add the code as below. <script> jQuery(document).ready(function($) { //your code starts here <iframe id=”myiFrame” class=”stop-lazy” data-src=”https://some.iframe” frameborder=”0″ allowtransparency=”true” style=”width: 100%;min-height: 150px;”></iframe> }); </script>

Changing copyright year in Footer.php with Custom plugin

As Jacob Peattie commented, there isn’t a standard way to do this that would work with all themes, but you can add an action to the wp_footer hook (https://developer.wordpress.org/reference/hooks/wp_footer/). This would add some content before the closing body tag. A simple implementation would be as follows: <?php /* Plugin Name: Year Footer Description: Add the … Read more

making a plugin that moves other plugins wp_head actions to wp_footer

Remove the action, then add it back on a different hook. I think the only concern you could have with doing this is ensuring you do that late enough for the action to have been hooked, it should possible using the plugins_loaded hook(because that runs after plugins have loaded). add_action( ‘plugins_loaded’, ‘juggle_sharethis_action’ ); function juggle_sharethis_action() … Read more

Contact information footer

Another option is to create a new post type called “modules” or something to that effect. Then you can create as many of those as you like, for example, “Footer: Contact Information,” “Footer: Social Media,” “Header: Callout,” etc, and you can use that post’s ID to bring it into the designated spots in your template. … Read more

How can I load certain JavaScripts only on blog pages?

Properly enqueue the scripts, via callback hooked into the appropriate hook Use contextual conditional tags to determine when to enqueue For example, you’d do something like: function wpse135482_enqueue_scripts() { // Only enqueue this script on single post pages if ( is_singular( ‘post’ ) ) { wp_enqueue_script( $args ); } } add_action( ‘wp_enqueue_scripts’, ‘wpse135482_enqueue_scripts’ ); Further … Read more