Redirect sub-page URLs to parent without changing URL
Milo’s comment got me there: add_rewrite_rule( “^{$slug}/”, “index.php?location={$slug}”, //changed query var to location ‘top’ );
Milo’s comment got me there: add_rewrite_rule( “^{$slug}/”, “index.php?location={$slug}”, //changed query var to location ‘top’ );
WordPress dynamic subpage for ACF
I don’t see why you can’t multisite. On the main site you’d just need to switch_to_blog(), get content from one of the group blogs, then restore_current_blog().
Add specific route for Custom Post Type (add/edit…)
You can disable the translate of your cpt in polylang and use translated pages to display your cpt posts. In your page template, detect if the current language is english and use your custom translation code to display those translated fields. I want an URL like : www.domainame.com/en/ You can set it up in the … Read more
Define a new sub-folder naming – Multisite
It sounds like you may be running into duplicate slugs. In a basic install I tried to create a Page with the URL example.com/category/ and that worked fine. My permalinks are set to example.com/category/categoryname/ for each individual category, and example.com/year/post-name/ for individual posts. You could either try changing your permalinks and removing /category/ from them … Read more
How to intercept not found URL, parse it, and generate dynamic result?
I fixed the problem by putting classes init in a wordpress hook wp_loaded as: function instantiate_class() { FP_Nav(); FP_Router(); } add_action( ‘wp_loaded’, ‘instantiate_class’, 100 ); which is before the do_parse_request action and after my CPT init in the hook init. I don’t know if it is the best way to handle this but it works … Read more
add_filter(‘do_parse_request’,function($state){ // Here you can change every request URL by $_SERVER[‘REQUEST_URI’] return $state; },1,1);