Different ‘WP_CONTENT_URL’ for different subsites in Multisite setup?

Is it possible to set different WP_CONTENT_URL values for different sub-sites in wp-config.php ? Ans: Yes it is. If sub sites are installed on sub-domain, An example to define it this way – define( ‘CURRENT_SITE_DOMAIN’, $_SERVER[‘HTTP_HOST’] ); if( ‘sub1.domain.com’ == CURRENT_SITE_DOMAIN ){ define( ‘WP_CONTENT_URL’, ‘http://sub1-abcdefghijk.cloudfront.net/wp-content’ ); } elseif( ‘sub2.domain.com’ == CURRENT_SITE_DOMAIN ){ define( ‘WP_CONTENT_URL’, ‘http://sub2-abcdefghijk.cloudfront.net/wp-content’ … Read more

Renaming wp-content folder dynamically

Don’t do what seems to be possible… You can use the possibility to change the WordPress constants WP_CONTENT_DIR and WP_CONTENT_URL in your wp-config.php. BUT it really, really, really, really is not recommended. Why? not recommended?? It’s pretty easy: Just do a cross file search (with your IDE or for e.g. Notepad++) for wp-content and you’ll … Read more

WP Config for FTP credentials

define(‘FS_METHOD’, ‘ftpext’); define(‘FTP_BASE’, ‘/path/to/wordpress/’); define(‘FTP_CONTENT_DIR’, ‘/path/to/wordpress/wp-content/’); define(‘FTP_PLUGIN_DIR ‘, ‘/path/to/wordpress/wp-content/plugins/’); define(‘FTP_PUBKEY’, ‘/home/username/.ssh/id_rsa.pub’); define(‘FTP_PRIKEY’, ‘/home/username/.ssh/id_rsa’); define(‘FTP_USER’, ‘username’); define(‘FTP_PASS’, ‘password’); define(‘FTP_HOST’, ‘ftp.example.org’); define(‘FTP_SSL’, false); http://digwp.com/2010/11/ftp-in-wpconfig/

Garbage in beginning of wp-config.php – was this WP installation compromised?

Yes, it appears so. In my experience the best thing to do is re-upload a fresh WordPress core to ensure that all traces have been squashed. It happens… If you aren’t already using security plugins I’d recommend Wordfence and BruteProtect to help keep brute force attacks out as well as checking your core WordPress files … Read more

Does changing ‘WPLANG’ in wp-config.php just effect the admin language or does it have other consequences?

WPLANG effects the whole site not just the admin section, you can use it in conjunction with WPML. It basically sets what language you have translations for but you must include a languages folder inside wp-include with the appropriate .mo and .po files. You can also set WPML to use the default languages directory ( … Read more

Override Current Theme Setting in wp_config.php

Drop this in a plugin & activate. I should note this doesn’t take into account things like child themes – it’s purely for toggling which theme renders based on SOME_FLAG. add_filter( ‘stylesheet’, ‘switch_ma_theme’ ); add_filter( ‘template’, ‘switch_ma_theme’ ); function switch_ma_theme() { // Return the theme directory name return SOME_FLAG ? ‘theme-1’ : ‘theme-2’; }

How To Make Connection To WordPress Data Base In A Plugin?

I found the answer my self. First open your wp-config.php and check the bottom of file that Is that contain the below code?… if ( !defined(‘ABSPATH’) ) define(‘ABSPATH’, dirname(__FILE__) . “https://wordpress.stackexchange.com/”); If yes then add the below code to make the connection in your plugin PHP files to connect with wp-config.php file that contain Database … Read more