Include Only on Front Page

Support MB Include Exclude Include Only on Front Page

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #4096
    mdrickettsmdricketts
    Participant

    How would I go about including my meta box only on the front-page.php?

    I know that I can do it by including by id or slug, but what if those things change. Am I able to do something like an is_front_page() check? I tried using 'template' => 'front-page.php' and that didn't work either.

    Thanks!

    #4097
    Anh TranAnh Tran
    Keymaster

    Hi,

    is_front_page() is a template function and I don't think it works in the backend.

    I suggest get the front page ID and check by page ID. To get the front page ID, just use get_option( 'page_on_front' ).

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Include Only on Front Page’ is closed to new replies.