Readfile of External CSS in Post and Place Up into style amp-custom in header

I’m trying to create a function that finds all external CSS files that may be included in the post body (such as for an embed), and do a readfile, and place the CSS it discovers up into the style amp-custom located in the header.

Sort of scratching my head on this one, so all feedback appreciated.

Cheers!
Ryan

Try this PHP function inside a function, test the result and if the value is is_dir(…) recurse the function. Final result is an array of file with “.css.” file extensions:

http://php.net/manual/en/function.glob.php

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.