Dynamic href link to Contact Page
If the contact page is identified solely by the associated template, you can query for a page with the template name in meta key _wp_page_template: $args = array( ‘post_type’ => ‘page’, ‘posts_per_page’ => 1, ‘meta_query’ => array( array( ‘key’ => ‘_wp_page_template’, ‘value’ => ‘contact_template.php’ ) ) ); $contact_page = new WP_Query( $args ); if( ! … Read more