Update template
-
I have tried for hours to figure this out, and I can’t.
If I use this
update_post_meta($post_id, "_wp_page_template", "page-joblistings.php");
it doesn’t update the template on the website itself. I checked the database, and it adds the correct values in the database. The correct post id is there, the correct template name is there, but it doesn’t update on the front end. If I go to the Page where I am trying to do this to, it shows the correct template in the template dropdown. If I hit the update button, it shows up on the front. WP Super Cache is enabled, but deleting that cache doesn’t fix it. I’ve tried to use wp_update_post with the page ID and maybe updating the time, but that doesn’t fix it.Any help would be appreciated!
- The topic ‘Update template’ is closed to new replies.