Going trough a WordPress template i found the get template
<?php
if ( is_home() ) {
get_template_part('home', 'featured');
get_template_part('home', 'recent');
}
?>
which calls certain template parts when the home page is displayed.
Is there a way to use the same function for certain pages? For example for domain-name.com/contact
?
Thanks
You can use
is_page
to determine the page. For example:The parameter to the function can be the Page ID, Page Title or Page Slug.