Title: appending php code
Last modified: April 5, 2018

---

# appending php code

 *  [doctorproctor](https://wordpress.org/support/users/doctorproctor/)
 * (@doctorproctor)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/appending-php-code/)
 * Greetings! We’ve used your Simply Static plugin successfully to archive sites
   on our ds.lclark.edu multisite in past, but now we need to move sites from that
   multisite to other hosts, and some of our students want to do this via a static
   HTML version using Simply Static.
 * One limitation we’ve experienced is the following:
 * > Simply Static creates a static copy of your website, which is just a collection
   > of files: HTML, CSS, JS, images, etc. Any functionality that requires PHP code
   > will not work with that static copy.
 * This limitation affects Display Featured Image for Genesis; see my [support thread there](https://wordpress.org/support/topic/backstretch-js-for-simply-static-html-archive/).
   As you’ll read, Robin replied that indeed her plugin requires PHP code functionality.
 * Can this functionality possibly be replaced by adding an external file with PHP
   code? That’s at least one possibility.
 * Many thanks,
 * Jim P.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fappending-php-code%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [tdmalone](https://wordpress.org/support/users/tdmalone/)
 * (@tdmalone)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/appending-php-code/#post-10152900)
 * This is a limitation you’ll hit with static sites in general – nothing can be
   dynamic, because then it wouldn’t be static 😉
 * I had a quick look at the post Robin made – if what her plugin collects is output
   as inline JS on the page (as it probably would be with wp_localize_script), it
   should work fine with Simply Static, although with the proviso that the code 
   that is output would be the options at site generation time, and obviously wouldn’t
   be dynamic after that.
 * In general you wouldn’t be able to re-add dynamic functionality relying on WordPress
   with one PHP file, as you’d need the entire WordPress framework present to process
   it (so then, there’d be no point going static at all). Adding some custom code
   for some simple dynamic functionality would be fine, but you’d then also lose
   the benefit of being able to use super-fast static hosting options like AWS’ 
   S3.
 * So it would kind of depend on your situation… having said all of that, it might
   even just be a missing script that you need to include in Simply Static’s settings!
   Are there any console errors – perhaps 404s on looking for scripts that Robin’s
   plugin uses? If not you might need to look at re-implementing the functionality
   in a purely frontend way, JS only.
 *  Thread Starter [doctorproctor](https://wordpress.org/support/users/doctorproctor/)
 * (@doctorproctor)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/appending-php-code/#post-10192174)
 * Sure appreciate…will look into possible errors further.
 * Regards,
 * Jim P.
 *  Thread Starter [doctorproctor](https://wordpress.org/support/users/doctorproctor/)
 * (@doctorproctor)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/appending-php-code/#post-10264133)
 * Our students have figured out an entirely different cause of this problem: the
   backstretch image path is specified incorrectly, e.g.:
 * `var BackStretchImg = {"src":".\/wp-content\/uploads\/sites\/430\/2018\/02\/228153a4-
   a451-4bdd-aa80-92be83a5ff03_1.78614d02d1f2372b2150abf18c992775.jpg"};`
 * should actually be
 * `var BackStretchImg = {"src":".\/..\/..\/..\/..\/wp-content\/uploads\/sites\/
   430\/2018\/02\/228153a4-a451-4bdd-aa80-92be83a5ff03_1.78614d02d1f2372b2150abf18c992775.
   jpg"};`
 * where the Simply Static directory structure (at least in our cases, with “Day
   and name” permalink settings) for each post is multiple directories inside the
   root.
 * They are, at present, doing a global find/replace, but (unless our diagnosis 
   is incorrect) a small bug fix would be great!
 * Sure appreciate,
 * Jim P.

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

The topic ‘appending php code’ is closed to new replies.

 * ![](https://ps.w.org/simply-static/assets/icon-256x256.png?rev=3622717)
 * [Simply Static - The Static Site Generator](https://wordpress.org/plugins/simply-static/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simply-static/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simply-static/)
 * [Active Topics](https://wordpress.org/support/plugin/simply-static/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simply-static/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simply-static/reviews/)

## Tags

 * [featured image](https://wordpress.org/support/topic-tag/featured-image/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 3 replies
 * 2 participants
 * Last reply from: [doctorproctor](https://wordpress.org/support/users/doctorproctor/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/appending-php-code/#post-10264133)
 * Status: not resolved