• I made my own theme. To allow others to download it, I currently pack it by hand and put it on the server in a download area.

    How would I automatically zip or tar the whole theme subdirectory as it is currently used to deliver it for a download? I guess it is more a PHP question, but since I want this to work in the context of WordPress …

Viewing 3 replies - 1 through 3 (of 3 total)
  • Not so much a php question as to what archive programs you have on your machine.

    On Windows, you could use any of the following zippers:
    https://www.pricelessware.org/thelist/fil.htm#File Compression: Zip-Unzip

    Thread Starter pifpafpuf

    (@pifpafpuf)

    No Windows, but this is not the point. I want a URL within WordPress that runs code to pack and deliver the theme directory when clicked. I think I could find the PHP code to use zlib, pack the stuff and dump it to the output, but this would result in garbled web-pages. I think what I need is to change the mime-type from text/html to something like application/zip. But where would I do this with PHP in WordPress?

    You would send a header(“Content-Type: application/zip”); and use zlib to zip up the files like you said.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘auto zipping and delivering the theme as currently used’ is closed to new replies.