How to get template link?

If you’re using that template for only one page, you can try this function: /** * @param string $template Base name of the template. */ function wpse_233924_get_page_link($template) { $query = new \WP_Query; // Get page which is using the $template. $page = $query->query([ ‘post_type’ => ‘page’, ‘meta_key’ => ‘_wp_page_template’, ‘meta_value’ => $template, ‘no_found_rows’ => 1, … Read more