Reputation: 3324
I am creating posts in wordpress programmatically using php. Is there a way to change the post attributes template either programmatically or using the admin panel for all posts? I would like the default to be Product details as you see in the picture below.
Any help appreciated. Thanks.
Upvotes: 1
Views: 719
Reputation: 387
after creating post programmatically assign page template.
update_post_meta( $post_id, '_wp_page_template', 'page-template.php' );
Upvotes: 2