New answers tagged

0

If the javascript file is loaded from the admin dashboard, you can use this javascript function get the root of your WordPress installation. function getHomeUrl() { var href = window.location.href; var index = href.indexOf('/wp-admin'); var homeUrl = href.substring(0, index); return homeUrl; } Then just contact the path to your theme like below. ...


0

If you're willing to create a child theme and put your PHP files in there, this approach is relatively clean. For each file, create a rewrite rule where you specify the path you want to use and the filename that should load. In the example below, /custom-path/ loads custom-file.php from the root of your child theme directory and /custom-path-2/ loads custom-...


0

You could create a page with the slug you want, and add a custom field that specifies the HTML path to output (in this example using either htmlfilepath or htmlurl as the metakey): add_action('wp','maybe_direct_html_output'); function maybe_direct_html_output() { if (is_singular()) { global $post; $htmlfilepath = get_post_meta($post->...



Top 50 recent answers are included