Print string to footer using wp_footer option

add_action(‘wp_footer’,’slider_option’); function slider_option() { $option =”<script>script function data </script>”; echo $option; } I want to print or you can say insert data in $option variable to footer menu Any suggestions? 2 Answers 2 Do you have to use a variable for you script? I have done this in the past and has worked… // add … Read more

Move all the JS files to the bottom|footer, the right way

In order to speedup my site load and prevent scripts from render the page I’m trying to move all the possible scripts (meaning JS files) from head to footer. After read and do some research I made this code: function footer_enqueue_scripts() { remove_action(‘wp_head’, ‘wp_print_scripts’); remove_action(‘wp_head’, ‘wp_print_head_scripts’, 9); remove_action(‘wp_head’, ‘wp_enqueue_scripts’, 1); add_action(‘wp_footer’, ‘wp_print_scripts’, 5); add_action(‘wp_footer’, ‘wp_enqueue_scripts’, … Read more

Change directory where get_header(), get_footer() and get_sidebar() look for templates

I’m creating my own theme framework, and I want to organize my code, separating the partials files from the pages. But I want to do that and still use the native functions get_header(), get_footer() and get_sidebar(). How can I change this functions to look for the templates on the directory partials/ instead of the theme’s … Read more

Template part vs Sidebar (differences)

I want to add a hard coded footer into the… footer.php of my site. This doesn’t need to be “dynamic” (adding and removing widgets), it will be something standard like info about the site and specific links. If I am correct this can be done either by get_template_part( ‘template-parts/’, ‘infofooter’ ); or by get_sidebar( ‘infofooter’ … Read more

How to edit footer

I’m using the ColorMag theme and I wanted to know how to edit the footer. What I’ve found is that: <?php do_action( ‘colormag_footer_copyright’ ); ?> Is showing the footer and I need to edit customizer.php for that purpose but don’t know what to edit as I’ve seen deleting a single line is resulting drastically so … Read more

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

I am getting a silent failure on the below code as I try to enqueue a static React.js script and hook its injecting div into the admin_footer. I see the page and my test echo plus the url of the script file. But the React application is not there, essentially the admin page is blank. … Read more

Make div stay at bottom of page’s content all the time even when there are scrollbars

CSS Push Div to bottom of page Please look at that link, I want the opposite: When the content overflows to the scrollbars, I want my footer to be always at the complete bottom of the page, like Stack Overflow. I have a div with id=”footer” and this CSS: #footer { position: absolute; bottom: 30px; … Read more