Title: Update template
Last modified: August 21, 2016

---

# Update template

 *  [Carl Wuensche](https://wordpress.org/support/users/stuffradio/)
 * (@stuffradio)
 * [13 years ago](https://wordpress.org/support/topic/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!

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [David Choi](https://wordpress.org/support/users/wpthemes777/)
 * (@wpthemes777)
 * [13 years ago](https://wordpress.org/support/topic/update-template/#post-3803560)
 * Try
 * 1. Delete your browser cache.
 * 2. See if your host uses some kind of cache server like Varnish.
 *  Thread Starter [Carl Wuensche](https://wordpress.org/support/users/stuffradio/)
 * (@stuffradio)
 * [13 years ago](https://wordpress.org/support/topic/update-template/#post-3803570)
 * 1. I tried visiting the page on other devices, and it didn’t work. So it’s not
   the browser cache.
 * 2. The host is inmotionhosting.
 *  [David Choi](https://wordpress.org/support/users/wpthemes777/)
 * (@wpthemes777)
 * [13 years ago](https://wordpress.org/support/topic/update-template/#post-3803577)
 * I don’t know anything about inmotionhosting, you’ll need to ask them about the
   caching. I had experience with some of my clients having issues with hosting 
   cache before. Clearing them (web server level) solved the problem.
 *  Thread Starter [Carl Wuensche](https://wordpress.org/support/users/stuffradio/)
 * (@stuffradio)
 * [12 years, 12 months ago](https://wordpress.org/support/topic/update-template/#post-3803651)
 * I found out that it is using index.php, but it shouldn’t because in the database
   it is saying that it’s using the template I assigned it. So it doesn’t make sense.
 *  Thread Starter [Carl Wuensche](https://wordpress.org/support/users/stuffradio/)
 * (@stuffradio)
 * [12 years, 12 months ago](https://wordpress.org/support/topic/update-template/#post-3803668)
 * I fixed it. It was happening because I was setting the post_parent to something
   else that wasn’t a page. It made the page show up as a 404. I wish I used the
   developer tools a long time ago to see if it was showing a 404.
 *  [David Choi](https://wordpress.org/support/users/wpthemes777/)
 * (@wpthemes777)
 * [12 years, 12 months ago](https://wordpress.org/support/topic/update-template/#post-3803669)
 * I see, glad the issue is solved and thanks for sharing.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Update template’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 6 replies
 * 2 participants
 * Last reply from: [David Choi](https://wordpress.org/support/users/wpthemes777/)
 * Last activity: [12 years, 12 months ago](https://wordpress.org/support/topic/update-template/#post-3803669)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
