I wrote a plugin that displays dynamic, non-WP (real estate) content in pages and posts. I allow the admin to select which theme template to use so that they can decide if my dynamic content will be full page or have a sidebar.
My plugin renders a few different types of dynamic content. Real Estate listing pages display correctly using the specified template. However, the Property Detail page is not displaying with the specified template - always defaulting to the theme default template. My debug clearly shows that I am correctly specifying the template to use.
I was originally using this to tell WP which template to use:
update_post_meta($posts->ID, '_wp_page_template', $roverTemplate);
I saw this problem, and wondered if it wasn't working because I was using a bogus page_id. So I created a record in wp_posts, got the page_id (ID) and used it. Same results. Hmmh.
I was just wondering if anyone had any suggestions on how to troubleshoot this.