Linking to Files in Root Directory Outside of WP Installation

Your first attempt does not work because get_template_directory_uri returns the URL to your theme directory. Your second attempt will work, but if you don’t want to hard code the domain you could either try using a root relative path or fetching the domain portion of your site url. Relative path: wp_register_script(‘circle-bounce’, ‘/js/general.js’, array( ‘jquery’, ‘jquery-effects-core’, … Read more

Cloudflare’s Rocket Loader + WordPress -> Ignore scripts?

Notice in the example that the tag does not have the type=”text/javascript” attribute. For some reason Rocket Loader requires data-cfasync=”false” to be used without the type=”text/javascript”… a bug? Your code does add the data-cfasync=”false” attribute, but does not override the WordPress behaviour of adding the type=”text/javascript” attribute also, which makes Rocket Loader not to “ignore” … Read more

Customizer JS API: Defining control settings

Settings must be registered in PHP one way or another. If you don’t register them statically via $wp_customize->add_setting() calls, you will have to register dynamic recognition of them via the customize_dynamic_setting_args filter. Why? In order for a setting to be safely stored it must be sanitized and validated by the server. Relying on client-side sanitization … Read more