Syntax of FS_CHMOD_DIR and FS_CHMOD_FILE

The basic syntax for define() is: define ( $name, $value ) In the above definition, the value is: ( 0755 & ~ umask() ) The ‘&’ (ampersand) is the ‘And’ bitwise operator, the ‘~’ (tilde) is the ‘Not’ bitwise operator, and the umask() function returns the current umask. To answer your question in short (if … Read more

How to use live images on local install?

Try to filter the output URLs temporarily to replace them with online images, using the following code: add_filter( ‘wp_get_attachment_image_src’, function ( $image, $attachment_id, $size ) { // For thumbnails if ( $size ) { switch ( $size ) { case ‘thumbnail’: case ‘medium’: case ‘medium-large’: case ‘large’: $image[0] = str_replace( ‘localhost/’, ‘EXAMPLE.COM/’, $image[0] ); break; … Read more

Missing a temporary folder despite settings in wp-config.php

try to use get_temp_dir() to see if wordpress is using your WP_TEMP_DIR constant. i’ve tried this code in wp-config.php and it works define(‘WP_TEMP_DIR’, dirname(__FILE__) . ‘/wp-content/temp/’); but you have to put it before the /* That’s all, stop editing! Happy blogging. */ in your wp-config.php file.

Override the wp_siteurl and wp_home not work

So dynamically set WP_SITEURL, WP_HOME, i override the wp-config as define(‘WP_SITEURL’, ‘http://’ . $_SERVER[‘SERVER_NAME’] ); define(‘WP_HOME’, ‘http://’ . $_SERVER[‘SERVER_NAME’] ); but when i call home_url() it always return x.co.uk hostname home_url() does not make use of any WordPress constants. It uses a call to get_option( ‘home’ ). To use WP_HOME instead, short circuit get_option(): add_filter( … Read more

How can I change preview URL?

You can do something like this, add to functions.php add_filter( ‘preview_post_link’, ‘the_preview_fix’ ); function the_preview_fix() { $slug = basename(get_permalink()); return “http://www.mywebsite.com/blog/p/$slug”; } More info HERE and HERE.

Password in wp-config. Dangerous?

The “Hardening WordPress” page of the Codex contains a section on “Securing wp-config.php”. It includes changing the permissions to 440 or 400. You can also move the wp-config file one directory up from the root if your server configuration allows for that. Of course there is some danger to having a file with the password … Read more

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