Notice: Constant WP_POST_REVISIONS already defined

I have the same problem before. I put WP_POST_REVISIONS in the end of wp-config.php file and it didn’t work correctly. You should put your codes before defining ABSPATH and before this line: /* That’s all, stop editing! Happy blogging. */ it must be something like in the following: define( ‘WP_POST_REVISIONS’, 6 ); /* That’s all, … Read more

multisite 404 error for subdirectory

I had the axact same problem. My solution: edited/etc/apache2/sites-enabled/000-default.conf. It needs to look like: <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html <Directory /> Options FollowSymLinks AllowOverride all </Directory> <Directory /var/www/> Options FollowSymLinks AllowOverride all Order allow,deny allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> It works!

What is the best way to get directory path for wp-config.php?

I came up with this solution. This function checks in each directory level starting from the directory of the current file for the file wp-config.php. <?php function find_wp_config_path() { $dir = dirname(__FILE__); do { if( file_exists($dir.”/wp-config.php”) ) { return $dir; } } while( $dir = realpath(“$dir/..”) ); return null; } ?> To actually include the … Read more

Connect to database using wordpress wp-config file

Using the defines the user sets in wp-config: mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); EDIT: Since your script is outside the WordPress environment, what you want to do is initiate it before using the defines in wp-config. require_once(‘./path/to/the/wp-config.php’); mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);

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