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?
- 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?
- Prevent Version URL Parameter (?ver=X.X.X) on Enqueued Styles & Scripts
- 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?
- 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?
- Auto get_header and get_footer on every template?
- Enqueue script in specific page
- How to en-queue bootstrap 4 to theme?
- Notice that the wp_enqueue_style is not being called correctly!
- Hyphens vs. periods in the script slug in wp_register_script?
- jquery script not enqueued in child theme
- Is This The Most Efficient Way To Add Javascript Files?
- Trying to load different syles for 404.php page
- Enqueue Script with URL parameters
- How to use wp_enqueue_style() and wp_enqueue_script() only when needed?
- Preload key requests using wp_enqueue
- Remove specific CSS and JS from the head
- Which are the MediaElement.js scripts to enqueue
- Sharing Header Components Across Multisite
- Best spot for wp_register_script() and wp_register_style()
- Help with enqueing scripts in footer after init action
- Asset loading with gulp.js or Grunt
- Adding custom fonts (local) to WordPress?
- wp_enqueue_script order – external vs inline js
- Dequeuing scripts for all pages but the home page
- Which jQueryUI handles are predefined in wordpress?
- Modernizr check first, then move on to wp_register_script()/wp_enqueue_script
- Deregister scripts on unnecessary pages using remove_action
- Prioritizing wp enqueue scripts error
- wp_enqueue and Dependencies
- How do you enqueue a Visual Basic script using wp_enqueue_script?
- Why are files enqueued with wp_enqueue_style and wp_enqueue_script 404 Not Found?
- How to place script in footer?
- jquery-ui-autocomplete is not loaded with wp_enqueue_script
- wp_enqueue_script Doesn’t Work?
- WordPress script file version numbers changing in live environment
- Is It Possible to add JS AFTER the Enqueue within the same Function?
- How can I manually enqueue plugin scripts
- How can I properly enqueue wp-hooks without issues?
- wp_dequeue_style and wp_dequeue_script not working on server but does work on local xampp
- Creating dynamic header and footer files
- wp enqueue, how to prevent duplication when same script is registered with different handles
- Localizing script to pass a value to a javascript function
- get_template_directory_uri not dependent on WP_HOME in wp-config.php?
- Dequeue script conditonnally
- why quotes shown in WordPress?
- Help to enqueue a js functions ( jquery) [closed]
- Conditionally load script depending on current admin page
- Enqueue script inside IE conditional comments
- How can I integrate Fancybox 3 in WordPress properly
- How to enqueue default scripts with dependency?
- Enqueuing a script before anything else
- Should I use get_bloginfo(‘stylesheet_directory’) or get_stylesheet_directory_uri() when enqueueing my js files?
- linking stylesheets and scripts with functions.php
- How to load API’s in WordPress?
- Adding Pinterest Script Before Closing Body Tag
- how to load css and js based on post template
- link to JS library using wp_enqueue_scripts not working
- Using wp_enqueue_script on scripts that contain PHP
- Enqueue specific script on account creation (and never again)
- Proper enqueue for child theme functions.php
- Custom headers in WordPress, are there also custom footers?
- loading javascript CDN with local fallback (not jQuery)
- How do I pass $in_foooter to wp_enqueue_script() without passing other params?
- Dynamic wp_enqueue_scripts?
- Why do I have to specify all parameters for wp_enqueue_script to load my jquery in the footer? [closed]
- Load scripts only for selected template
- How do you remove header sitewide from mobile only?
- wp_enqueue_script error with `ID`, `post_title`, `post_name` of none object
- How to enqueue a script on a specific URL that contains multiple parts
- Duplicate Header and Footer
- Enqueue Script only over specific WordPress core file
- wp_enqueue_script silently fails [closed]
- How to enqueue an external Javascript file to Frontpage footer
- How to include a JS file in this theme?
- WOW.js Script Tag Initialization Header/Footer
- wp_enqueue doesn’t load dependencies
- different contents and same sidebar approach?
- How to reuse parts of WordPress site e.g. header, footer, part of header for multiple WordPress sites?
- My CSS, footer and header don’t show up!
- Should I use wp_register_style(), wp_enqueue_style, or both?
- Footer option is missing in Customiser