The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Adding custom meta boxes to custom template (1 post)

  1. rikardo85
    Posted 3 years ago #


    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

Topic Closed

This topic has been closed to new replies.

About this Topic