Blog Templates not recognizing page templates

Don't exactly have the fix yet but found the problem and will post it when I do.

Blog Templates uses wp_insert_post() to add new posts and pages. But that function no longer takes the page_template info. That must be added using update post meta().

  • Marty Thornley

    Okay, here we go, got it working...

    In the version I had, these lines were around 438-442, inside the gb_apply_templates() function:


    if( $page['post_template'] ) {
    $post_array['page_template'] = $page['post_template'];
    }
    $post_array['menu_order'] = $page['menu_order'];
    $post_id = wp_insert_post($post_array);

    I replaced that with this:


    $post_array['menu_order'] = $page['menu_order'];
    $post_id = wp_insert_post($post_array);
    if( $page['post_template'] ) {
    update_post_meta($post_id, '_wp_page_template', $page['post_template']);
    }

    Now all page templates are recognized in the new blogs.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.