0
add_action( 'page_template', 'fw_reserve_page_template_pending', 99 );
function fw_reserve_page_template_pending( $page_template ){
    $page_template = /* My template Path */
    return $page_template;
}

This hook of mine work for all page but home page and front page. Any idea for me to make it work it in both home page and front page so that whenever I click on a page or lunch my site it goes to /* My template Path */

2
  • Do you have any front-page.php or home.php in your theme files? In that case, they will take precedence over the template files. Have a look here.. developer.wordpress.org/themes/basics/template-hierarchy
    – Abhik
    Commented Aug 21, 2015 at 4:33
  • No I don't. The home page is default. I also do not set any in Dashboard > Setting > Reading > Posts Page, Front Page
    – Trang
    Commented Aug 21, 2015 at 4:35

1 Answer 1

0

That is because page_template action really works only for "Pages". Not for blog listing / home ...

You can use template_include hook with broader impact.

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.