Support » Fixing WordPress » Adding custom meta boxes to custom template

  • Hello,

    I am looking to display my custom meta boxes on a custom page tmeplate.

    I have created the CMB without any problems along with the page template.

    I have found some answers on various forums but these do not seem to work for me.

    I have found the following:

    function featureBoxes()
    $post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ;
    $template_file = get_post_meta($post_id,'_wp_page_template',TRUE);
    if ($template_file == 'boxes.php')
            'Feature box',
            'Feature box',

    Any help much appreciated

  • The topic ‘Adding custom meta boxes to custom template’ is closed to new replies.