I'm wondering if, in the static front page, is possible to detect if the some page template has been selected for my page. I'm building a template and I'd like to have a static front page, but I'd like to load a particular page-template just in the case my client selected it in the page Attributes, otherwise will be load the standard page structure.

Is it possible?

Thank you for any help or clue!

1 Answer 1


sure it is possible. Just check the page meta field (assuming you're in the loop):

$template = get_post_meta( get_the_ID(), '_wp_page_template', true );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.