• doctorproctor

    (@doctorproctor)


    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. 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 to see the link]

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

    (@tdmalone)

    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

    (@doctorproctor)

    Sure appreciate…will look into possible errors further.

    Regards,

    Jim P.

    Thread Starter doctorproctor

    (@doctorproctor)

    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.