• On a client site, I’m seeing lots of error notices like this:

    File does not exist: /path/to/wp/wp-content/themes/canvas/simple-staff-list-custom.css

    It looks like your plugin allows users to generate custom CSS in the admin panel, and you then attempt to save it to get_stylesheet_directory() . '/simple-staff-list-custom.css'. On this particular installation, the Apache user doesn’t have write-access to the theme directory, so file_put_contents() fails. This results in the feature not working, and also results in errors when a non-existent stylesheet is enqueued in sslp_staff_member_enqueue_styles().

    Two suggestions:

    1. Don’t try to save this file in the theme directory. By all means, you should *look* in the theme directory, in case someone ships custom styles with their theme. But don’t try to write there. Instead, write someplace that’ll be reliably accessible: https://teleogistic.net/2013/04/11/wordpress-developers-write-to-the-filesystem-the-right-way/

    2. Make sure the file exists before enqueuing it:

    if ( get_option( '_staff_listing_write_external_css' ) == "yes" && file_exists( get_stylesheet_directory() . '/simple-staff-list-custom.css' ) ) {

    https://ww.wp.xz.cn/plugins/simple-staff-list/

Viewing 1 replies (of 1 total)
  • Plugin Author Brett Shumaker

    (@brettshumaker)

    Hey Boone –
    Thanks for letting me know. I’m teaming up with some local Nashville devs to rework and add some features to the plugin this year and the external stylesheet is one of our top priorities. I know I didn’t do it the right way initially. 🙂

    If you haven’t already fixed it, you should be able to just uncheck the Write to external CSS file? checkbox on the plugin’s “Templates” page to prevent it from trying to write it to file.

    Thanks!

Viewing 1 replies (of 1 total)

The topic ‘Theme directory not writeable for simple-staff-list-custom.css’ is closed to new replies.