Skip to content

Conversation

@richplane
Copy link

The hide_on and show_on settings wouldn't recognise "front-page.php" and "home.php" as page-template values, because the wp_postmeta just has these as 'default'.

So I've altered the two functions show_for_page_template and hide_for_page_tempate(), which perform the test against the given template slugs. In the case where the postmeta shows "default" they now test the current post against the front page and posts page from the site options.

add_for_page_template() and hide_for_page_template() will now detect the use of "front-page.php" and "home.php" templates.
@richplane
Copy link
Author

If anyone else was waiting for this, here's a workaround: use

array(
    'show_on' => array(
        'id' => get_option('page_on_front')
    ),
    ....

...and 'page_for_posts' works for home.php.

@mikeselander mikeselander changed the base branch from master to develop November 11, 2016 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants