phpwordpressmeta-boxes

Wordpress CMB2 show-on page template - default page template


I am using CMB2 and would like to only show a particular CMb2 metabox on the default page template. I have tried passing a value of page.php as the value of the show-on filter but its not working. Any ideas welcome? I could write my own custom show-on filter but I am sure the functionality must already exist.


Solution

  • It's been a while, so maybe you've found the answer. But since I've been looking myself as well, let me post the result here for future reference.

    The solution is simply, instead of 'page.php', just use 'default' as the value for the show-on filter:

    'show_on' => array( 'key' => 'page-template', 'value' => 'default' )