Enqueue AWS Script

Try to save jQuery.noConflict(); as jquery-no-conflict.js. Then enqueue everything with proper dependencies: <?php function img_scripts_with_jquery() { wp_enqueue_script( ‘jquery-no-conflict’, ‘path/to/jquery-no-conflict.js’, array( ‘jquery’ ), ‘version’, true ); wp_enqueue_script( ‘aws-cba’, ‘https://images-na.ssl-images-amazon.com/images/G/01/cba/js/common/cba_shared.js’, array( ‘jquery-no-conflict’ ), ‘version’, true ); wp_enqueue_script( ‘aws-merchant-cart’, ‘https://images-na.ssl-images-amazon.com/images/G/01/cba/js/shoppingcart/merchant_cart.js’, array( ‘jquery-no-conflict’ ), ‘version’, true ); } add_action( ‘wp_enqueue_scripts’, ‘img_scripts_with_jquery’ );

Securing my WordPress Files and Directories

Why would you want to protect them all? Not all of them need protecting, in my humble opinion. In any event, these are good to have in your .htaccess file: 1: restrict access to wp-config.php <Files wp-config.php> order allow, deny deny from all </Files> 2: restrict access to .htaccess itself <Files .htaccess> order allow,deny deny … Read more

Using audio shortcode for .mp3 URLs with a query string

The problem: The problem seems to be that wp_check_filetype() doesn’t recognize mp3 files with GET parameters. Possible workarounds: You have two options as far as I can see: 1) Override the audio shortcode with the wp_audio_shortcode_override filter. 2) or allow any audio extensions via the wp_audio_extensions filter. Here’s an example how you can implement the … Read more

How to put wordpress site behind AWS load balancer

When WordPress is behind https proxy (your load balancer) it doesn’t know that https is enabled. Proxy is working through https (443 port) but communication between proxy and WordPress is through http (80 port). For WordPress traffic is through http, that’s why you get redirect loop from https to http (by WordPress) and again from … Read more

How can I add programmatically custom taxonomy terms to a custom type post when saving posts?

So, to answer my own question: I haven’t found any solution inside wp_insert_post_data. I suspect that the problem is connected to the fact that when wp_insert_post_data is executed the post in question is not yet in the database. And albeit I didn’t manage to find it in taxonomy.php, it is logical to assume that the … Read more

Upgrade to SSL Breaks Admin Dashboard

Not sure what plugin you are using to enforce SSL, but I would disable it to prevent conflicts with the possible solution below. To make sure you’ve updated all of your URLs to the HTTPS, do the following: Go and download Interconnect IT’s Database Search & Replace Script here Unzip the file and drop the … Read more

Multisite, upload images directly to Amazon S3

If you are running on a dedicated linux server and are comfortable with the command line, you could install s3fs. This is a program that allows you to actually mount your Amazon s3 Bucket as a directory on you server. In the standard multisite environment, media uploads for all sites but the main site are … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)