I am creating a gallery of orphans available for adoption by allowing a user to upload details about the child and create a page (not a post) for each child’s profile. My issue is that I’d like to change the page attributes when creating the page. Namely:
1. Change the page template to our “gallery” template instead of the default.
2. Change the hierarchy so that these pages that are created fall under a Parent page.
Is this possible?




October 18, 2012 at 10:18 am
If the template and parent will be the same for every page, you can add a bit of custom code to do this. Here's a related post for setting the parent:
http://formidablepro.com/help-desk/how-to-identify-the-parent-page-for-a-created-post-from-a-form/
You can add this line to set the post template:
$_POST['frm_wp_post_custom']['=_wp_page_template'] = 'my-page-template.php';
October 18, 2012 at 3:04 pm
Thanks Stephanie! I can always count on you to help me!
For the record, I decided that the best way to accomplish what I wanted is to create a custom post template for each category. This way we can display each child's profile as a post, but not style it like the other blog posts. This also takes care of the page hierarchy using categories.
If anyone is interested, I would be happy to post how to do this.
Topic closed.