For what it’s worth, I found a solution to my problem and posting it here for other lost souls 🙂
<?php
require_once("wp-blog-header.php"); /* setup the wordpress environment */
// This is to fool the system
// In order for wp_footer() to execute, we need to run wp_head() but since we don't want the output of the header again,
// we put it in a buffer, execute the function and then clear the buffer resulting in what we need
ob_start();
wp_head();
ob_clean();
require_once(dirname(__FILE__) . "/includes/footer.php");
?>
Related Posts:
- Wp_head and wp_footer vs wp_enqueue_script javascript files?
- How to load css in the footer [duplicate]
- wp_enqueue script my_javascript_file in the footer
- Hook for writing text string after footer scripts
- Add script to footer – on post editor
- How do I enqueue a JavaScript in my footer via the functions.php file?
- wp_head() – list hooked actions with priorities?
- JavaScript enque stopped working
- All of my Scripts and Enques are getting file not found
- How Do I Enqueue a Script into 2 different Footers on the Same Site?
- Moving Javascript from footer to header
- Most optimal way of starting fresh, without using other theme or dropping old files?
- When should I use wp_register_script() with wp_enqueue_script() vs just wp_enqueue_script()?
- What does wp-embed.min.js do in WordPress 4.4?
- wp enqueue inline script due to dependancies
- How do I dequeue a parent theme’s CSS file?
- Check if a script/style was enqueued/registered
- wp enqueue style on specific page templates
- Is it possible to use wp_localize_script to create global JS variables without a specific script handle?
- How do I get the $handle for all enqueued scripts?
- How can I get a list of all enqueued scripts and styles?
- Load CSS/Javascript in frontend conditionally if block is used
- How to properly dequeue scripts and styles in child theme?
- Prevent Version URL Parameter (?ver=X.X.X) on Enqueued Styles & Scripts
- Register a script to be enqueued both in admin and front end
- How can I enqueue protocol relative external (//ajax.googleapis.com/…) scripts?
- Can’t enqueue scripts in the footer?
- How can I remove the site URL from enqueued scripts and styles?
- How can I de-register ALL styles all at once? And same with Javascript?
- Loading a script with a dependency, is unloading another script’s dependency
- wp enqueue script using scripts from cdn with a safety callback
- Can I add styles to footer with $wp_styles->add_data?
- Cannot deregister a script using wp_deregister_script
- Auto get_header and get_footer on every template?
- Conditional wp_enqueue_script on a page
- Enqueue custom font file with rel=”preload”
- How do I force wp_enqueue_scripts to load at the END of ?
- Protocol neutral URLS with wp_enqueue_script (SSL issues)?
- Enqueue script in specific page
- Removing specific style from wp_head
- How to dequeue / deregister any theme styles and scripts
- How to en-queue bootstrap 4 to theme?
- Notice that the wp_enqueue_style is not being called correctly!
- Why is jquery-ui-core enqueueing in my footer instead of the header?
- Is it safe/recommended to use wp_enqueue_script function outside the functions.php file?
- Hyphens vs. periods in the script slug in wp_register_script?
- jquery script not enqueued in child theme
- Using wp_enqueue_script on shortcode function handler
- Get the list of enqueued/registered scripts for a specific post?
- How to load JQuery easing script in wordpress?
- Enqueue script only for IE
- Is This The Most Efficient Way To Add Javascript Files?
- Why does this line of code make photo albums appear?
- Which action to hook wp_enqueue_script to? wp_head or wp_enqueue_scripts? [duplicate]
- enqueue and localize script in footer
- Issue with using Underscore in WordPress
- Conditionally dequeue dependency of scripts
- Trying to load different syles for 404.php page
- Enqueue Script with URL parameters
- What determines the order of enqueued styles?
- Track down where script is being enqueued from
- $wp_styles->registered not giving ALL the styles?
- Benefits to enqueuing site scripts/stylesheets?
- Enqueue script only if page has an oembed
- Adding Custom Javascript to Skeleton Child Theme
- enqueuing React script and hooking its target div fails to load script
- It would be a right way to enqueue the script using foreach loop?
- How to use wp_enqueue_style() and wp_enqueue_script() only when needed?
- Is this a bad implementation of wp_enqueue_script for conditional usage?
- Preload key requests using wp_enqueue
- Don’t load scripts if on mobile/tablet
- How to Add a Custom Script to Customize.php
- Remove a script from a template file using wp_dequeue_script
- Problem in wp_localize_script
- Remove specific CSS and JS from the head
- wp_enqueue_script vs. wp_register_script
- Enqueue scripts to a specific header-.php?
- Adding dependencies to script enqueing
- Which are the MediaElement.js scripts to enqueue
- Child Theme – what is the scope of overwriting files?
- How do you completely remove the default header and footer using functions.php?
- Best way to enqueue extremely popular scripts like bootstrap and font awesome
- How to dequeue / deregister parent theme style
- Enqueue scripts to footer
- How to remove some external js files from source?
- Enqueued scripts and styles loading in WordPress Dashboard as well
- Why is it wrong to use admin_print_scripts-{hook} to enqueue a script (.js) file?
- Add last modified time as version to css and js
- Sharing Header Components Across Multisite
- Enqueue script on specific WooCommerce template
- The wp_enqueue_scripts hook doesn’t work at all, not from plugin, not from the template, not for frontend, not for admin pages!
- How can I load script and style in specific page in the back-end?
- Best spot for wp_register_script() and wp_register_style()
- Custom Plugin Development: What priority should wp_enqueue_scripts have?
- Change directory where get_header(), get_footer() and get_sidebar() look for templates
- Move all the JS files to the bottom|footer, the right way
- Enqueueing Scripts on a Custom Top-level Menu Page
- Enqueue script with url_query variables?
- Inserting JS snippet in the footer if there is no wp_footer?
- Select2 in WordPress