For anyone else who needs it, I solved it as follows via a plugin:
(1) The first block of code needed to be triggered with: add_action( 'wp_loaded', 'redirect_block' );
(2) The second block involving redirects was originally after the wp();
call in wp-blog-header.php, so in the plugin it is triggered as follows: add_action( 'wp', 'redirect_old_style_urls' );
Related Posts:
- Using wordpress and codeigniter in one website
- Limiting conditional comment to home only in header.php
- how to add H1 in title site?
- Fatal error: Uncaught Error: Call to undefined function wp()
- include multiple wp-blog-header.php from different blogs
- Body tag in header AND template/footer?
- What is the function of wp() in wp-blog-header.php
- My first web wp-blog-header.phd
- my header.php page got erased when i trying to post google tag manger code , how can i retrieve it, rest of the theme is ok
- What is the correct way to use WordPress functions outside WordPress files?
- Creating a Dynamic Path to wp-blog-header.php
- Why I have this error when I try to install this old blog on my local webserver?
- How to load wordpress environment without loading the template?
- there’s a way to include a minimal WP for check only the current user, its roles (caps?) and then release/free it?
- Force pdf download not working when include blog-header.php
- Using plugin functionality in external php script not working
- Fatal error: Call to undefined function get_post() with ajax
- Downsize CPU & DB usage in wordpress
- include wp-blog-header not working on MAMP
- Using WPDB to output raw XML fails because of wp-blog-header.php
- Call to undefined function wp() in wp-blog-header.php
- Why I have this error when I try to install this old blog on my local webserver?
- Right way to include blog-header.php?
- How to select a specific page
- How to run a function after wp() in the wp-blog-header.php file?
- WordPress archives in header -necessary?
- WordPress Website with Login system
- Cannot Modify Header Information – While trying logging in
- Loading wp-load.php in an external PHP file throws unknown error
- Show preview of wordpress posts on external html sever
- Add custom field information to source meta data
- How to call WordPress PHP file using external js file
- How to extract some part of WordPress full source code
- Allow the execution of an external PHP script for logged users
- Could not find wp-load.php issue
- why get_header doesn’t work twice in a test
- Get permalink of a post without using WordPress functions
- Why I have this error when I try to install this old blog on my local webserver?
- Blog page is not showing properly
- Include root files into header files
- Is it ok if I use this tag?