Title: [Plugin: Archivist &#8211; Custom Archive Templates] Error when activating
Last modified: August 20, 2016

---

# [Plugin: Archivist – Custom Archive Templates] Error when activating

 *  [AndrewGail](https://wordpress.org/support/users/andrewgail/)
 * (@andrewgail)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-archivist-custom-archive-templates-error-when-activating/)
 * The error is:
 * > Parse error: syntax error, unexpected T_FUNCTION in /home/public_html/wp-content/
   > plugins/archivist-custom-archive-templates/archivist.php on line 313
 * Issue seems to be with declaring functions inside the `preg_replace_callback()`
   function. Quickly moving the function out and passing the callback function name
   as a sting (e.g. ‘TAGS_callback’) seemed to work but there are lots of calls 
   to `preg_replace_callback()` within the `main render_element()` function.
 * I’ll try for a more elegant solution later.
 * [http://wordpress.org/extend/plugins/archivist-custom-archive-templates/](http://wordpress.org/extend/plugins/archivist-custom-archive-templates/)

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

 *  Plugin Author [Eric Teubert](https://wordpress.org/support/users/eteubert/)
 * (@eteubert)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-archivist-custom-archive-templates-error-when-activating/#post-2517693)
 * Hi Andrew,
 * Yes, these anonymous functions require PHP 5.3. I might consider to restore backward
   compatibility to PHP 5.2.x doing what you described. Unfortunately, nothing beats
   the elegance of anonymous functions in that use case 🙂
 *  [Cris!](https://wordpress.org/support/users/cjolliff/)
 * (@cjolliff)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-archivist-custom-archive-templates-error-when-activating/#post-2517890)
 * PLEASE!!!?!?!?
 * I would very much like to use this plug-in, and would be happy to publicly endorse
   it on my websites, but it needs to be deprecated back to PHP 5.2.
 * I would even be willing to make a donation to your efforts to entice you to seek
   a fix more quickly…
 *  Plugin Author [Eric Teubert](https://wordpress.org/support/users/eteubert/)
 * (@eteubert)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-archivist-custom-archive-templates-error-when-activating/#post-2517891)
 * PHP 5.2 compatibility is restored now in version 1.4.
 *  [Cris!](https://wordpress.org/support/users/cjolliff/)
 * (@cjolliff)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-archivist-custom-archive-templates-error-when-activating/#post-2517892)
 * Default template seems to be breaking the page…
 * See an example of this:
    [http://www.sandiegowebguy.biz/services/archivist-test-page/](http://www.sandiegowebguy.biz/services/archivist-test-page/)
   View page source. Everything after the table is missing, and the table isn’t 
   being rendered, either.
 *  Plugin Author [Eric Teubert](https://wordpress.org/support/users/eteubert/)
 * (@eteubert)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-archivist-custom-archive-templates-error-when-activating/#post-2517895)
 * Hi Cris,
 * do you have access to your PHP error log? There must be an error breaking the
   script after printing the “before template” part. It would help me to figure 
   out the bug.
 * Furthermore, could you please paste the shortcode you are using?
 *  Plugin Author [Eric Teubert](https://wordpress.org/support/users/eteubert/)
 * (@eteubert)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-archivist-custom-archive-templates-error-when-activating/#post-2517904)
 * My fault, I forgot to add the new file I added to the repository … quite embarrassing.
   Fixed in 1.4.1.

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

The topic ‘[Plugin: Archivist – Custom Archive Templates] Error when activating’
is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/archivist-custom-archive-templates_f2f2f2.
   svg)
 * [Archivist - Custom Archive Templates](https://wordpress.org/plugins/archivist-custom-archive-templates/)
 * [Support Threads](https://wordpress.org/support/plugin/archivist-custom-archive-templates/)
 * [Active Topics](https://wordpress.org/support/plugin/archivist-custom-archive-templates/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/archivist-custom-archive-templates/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/archivist-custom-archive-templates/reviews/)

 * 6 replies
 * 3 participants
 * Last reply from: [Eric Teubert](https://wordpress.org/support/users/eteubert/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-archivist-custom-archive-templates-error-when-activating/#post-2517904)
 * Status: not resolved