Fix Custom Post Template Plugin for WordPress 2.9

Posted by Chris at 2:11 PM on December 20th, 2009

Odds are if you were using the Custom Post Template plugin and upgraded to WordPress 2.9, it broke. Luckily, there is a very simple fix while you wait for an official update. Navigate to your plugins directory, pop open the file named ‘custom-post-templates.php’ and find line 126. Replace the whole line with the following:

$template_data = implode( '', file( $template ) );

That should take care of it. Enjoy!

13 Responses to “Fix Custom Post Template Plugin for WordPress 2.9”

  1. Leannekera says:

    Thank you very much Chris, I panicked when I upgraded and saw the post templates of the current site i am working on mess up!

    :)

  2. Paul says:

    Thanks Chris. You should post this over at themeforest too.

  3. John says:

    Oh boy, you really saved the day! Thanks so much Chris!

  4. Thanks for the fix. This was driving me insane.

  5. Indusekar SK says:

    Thanks for the fix. I shocked to find continuous error shown in the posts area.

  6. Jeff Morrow says:

    Thank you! THANK YOU! Works like a charm.

    Custom Post template is soooo essential, I just don’t understand why more people / designers take advantage of it.

  7. mT says:

    I’m getting a fatal error message for line 29. what’s the fix on that?

  8. Hi,

    Apologies for the delay in addressing this, but you should find the latest version (v1.0) addresses this issue.

    @mT – That line breaking would indicate that not all the required files for the plugin are uploaded, please try uploading the custom-post-template folder again.

    Best regards,

    Simon

  9. Kyle says:

    awesome, thanks for the fix!!

  10. Vinnie Ryan says:

    Thank you for the fix, I hope this will work fine on coming version of WP too.

  11. pez says:

    Thank you so much for pointing this out, you just saved me with a client!!

    Ciao

  12. Julien says:

    Yes !!!

    I was looking for it desesperatly,
    Thanks Chris !

  13. Justin says:

    I’m trying to activate this under WP2.9 and it triggered a fatal error:

    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /nfs/c04/h03/mnt/65448/domains/addsomebrown.com/html/wp-content/plugins/custom-post-template/custom-post-templates.php on line 38

    I’ve tried removing and adding again thru WP and also manually thru my ftp. Would it possible to get some help? Thx!

Leave a Reply