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

This topic contains 1 reply, has 2 voices, and was last updated by  Anh Tran 1 day, 9 hours ago.

  • Creator
    Topic
  • #14169

    Vladimir Mujakovic
    Participant

    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
    Replies
  • #14178

    Anh Tran
    Keymaster

    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.