Passing parameters from PHP to Javascripts in plugins » Otto on WordPress

Much cleaner. One static and unchanging JS file to cache. Parameters get put into your HTML itself as a one-liner. You can deal with the parameters using a normal PHP array before passing them over. No need to screw around with generating Javascript from PHP or looking for wp-load or even messing with tricky actions.

via Passing parameters from PHP to Javascripts in plugins » Otto on WordPress.

How to Add www. – or Remove www. – From Your URL

This has been done many times by others, but just a quick tip on how to add or remove www. from your website’s address. This is helpful for URL canonicalization and user experience consistency. You can also achieve SEO-friendly canonicalization using rel="canonical". Oh boy, I’m getting too technical 🙂

Here’s the juicy part:

Add the following to the .htaccess file in your website’s root folder (often named public_html or www). If there’s not a file named .htaccess, you may create it. If you are creating the .htaccess file, set the permissions to 644. For security reasons, you don’t want others to be able to write to this file. Continue reading “How to Add www. – or Remove www. – From Your URL”

How to Prevent Loading WP-DownloadManager's CSS File

Stop loading WP-Downloads CSS File

If you want to disable the WordPress plugin WP-DownloadManager‘s download-css.css file from being loaded, add the following code to your functions.php file:

remove_action('wp_print_styles', 'downloads_stylesheets');

Alternatively, if you would just like to use your own stylesheet, you can add a file named download-css.css to your theme’s directory, and the plugin will automatically load your stylesheet instead.