Custom Fields
Support Meta Box Show Hide (Javascript) Not showing on specified template

  • Creator
  • #14169
    Vladimir Mujakovic

    I am attempting to show a metabox only on a specified template, I have added the code as shown in the demo, but the metabox will not show under any conditions.

    $meta_boxes[] = array( 
        'title' => esc_html__( 'Carousel', 'metabox-online-generator' ),
        'pages' => array('page'),
        'show' => array(
            'template' => array('../templates/page-product-tech-template.php'),
        'fields' => array();

    The file I am targeting is in the adjacent folder. So when i'm specifying the path I am backing out once and entering the templates directory, is this correct?

Viewing 1 replies (of 1 total)
  • Author
  • #14178
    Anh Tran

    Hi Vladimir,

    Please set the template to the path of the template file, without .., e.g. templates/page-product-tech-template.php.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.