开发者 | diana_burduja |
---|---|
更新时间 | 2024年2月1日 18:31 |
PHP版本: | 5.2.4 及以上 |
WordPress版本: | 6.5 |
版权: | GPLv3 |
版权网址: | 版权信息 |
wp-content/plugins
directory.custom-css-js
folder to this directory location.If you write multiple codes of the same type (for example: two external CSS codes), then all of them will be printed one after another
When you click the Save
button the codes will be cached in files, so there are no tedious database queries.
No, the code is printed exactly as in the editor. It is not modified/checked/validated in any way. You take the full responsability for what is written in there.
Try one of the following:
wp-content/uploads/custom-css-js
folder exists and is writableYes.
The CSS and JS are independent of the theme and they will persist through a theme change. This is particularly useful if you apply CSS and JS for modifying a plugin's output.
For the moment only plain CSS is supported, but you can check out the Pro version in case you need a CSS preprocessor.
Yes. You can upload an image to your Media Library, then refer to it by its direct URL from within the CSS stylesheet. For example:
div#content { background-image: url('http://example.com/wp-content/uploads/2015/12/image.jpg'); }
Yes.
By default only the Administrator will be able to publish/edit/delete Custom Codes. On the plugin activation there is a role created called Web Designer. You can assign this role to a non-admin user in order to allow to publish/edit/delete Custom Codes. On the plugin's Settings page there is an option to remove this role.
The URL for the linked Codes is built just like the URL for other media (from Media Library) by using the WordPress Address option found on the WP Admin -> Settings -> General page, as shown in this screenshot. If the WordPress Address has HTTPS in the url, then the Custom Codes and all the other media will have HTTPS in the url.
HTML Editor Syntax Highlighter
pluginwp_footer
function for the footer scripts, as the print_footer_scripts
function is used also in the admin, which lead to many broken back-endsprint_footer_scripts
function for the footer scripts (https://wordpress.org/support/topic/footer-code-position-before-external-scripts-is-overridden/)deactivate code
star wasn't working when first time clickedshortcoder
plugin.slug
metaboxadmin_head
instead of admin_enqueue_scripts
for external files in order to add priority to the code