• Resolved Andrew Rothman

    (@arothman)


    I want to change the page template that the WP All Import (Pro) plugin is applying to my import (right now it appears to be applying the single.php / blog template to everything). The only option in the Options > Page Template dropdown is ‘Default’. My child theme has other templates, so perhaps I’m just not clear on where this dropdown is looking for the list. What directory should I put the alternate template into for it to show up there?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WP All Import

    (@wpallimport)

    Hi @arothman,

    My child theme has other templates, so perhaps I’m just not clear on where this dropdown is looking for the list. What directory should I put the alternate template into for it to show up there?

    We use this function for the drop-down: https://developer.www.ads-software.com/reference/functions/page_template_dropdown/, which uses this function to fetch the templates: https://developer.www.ads-software.com/reference/functions/get_page_templates/. So, you can place your template file in the root directory of your child theme and it will show in the drop-down.

    Thread Starter Andrew Rothman

    (@arothman)

    The reason I was asking is that the dropdown is not showing the templates that are in the root. When I go to the normal Add Page in WP my ‘Page Templates’ dropdown has over a dozen options, but in WP All Import I’m only getting ‘Default’.

    Thread Starter Andrew Rothman

    (@arothman)

    I was able to get this to work by using a custom function to force the correct template post-save:

    function set_template( $post_id, $xml_node, $is_update ) {
    $import_id = wp_all_import_get_import_id();
    if ( $import_id == ‘1’ ) {
    // Set the page template meta key.
    update_post_meta( $post_id, ‘_wp_page_template’, ‘page-templates/current-job.php’ );
    }
    }
    add_action( ‘pmxi_saved_post’, ‘set_template’, 10, 3 );

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Page Template Dropdown – Where is it looking?’ is closed to new replies.