Best way to load WordPress Bootstrap

Requiring a file using relative path is never a good idea, that because wp content folder can be easily changed and that make your code fail. You should convert your file into a MU plugin (you only need to save it wp-content/mu-plugins folder) and change it to something like: add_action( ‘wp_ajax_super_custom_stuff’, ‘my_super_custom_stuff’ ); add_action( ‘wp_ajax_nopriv_super_custom_stuff’, … Read more

How to avoid wp-load.php within a PHP/CSS file?

Here is a basic setup that I use for AJAX with WordPress. instead of loading wp-load.php; just use WordPress default method for AJAX calls. This allows you to also filter function calls from Javascript through a switch. I also added a quick example for wp_localize_script. <?php add_action(‘wp_enqueue_scripts’, ‘YOUR_NAME_scripts’); //back end function YOUR_NAME_scripts( $hook_suffix ) { … Read more

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