Creating the wp-config.php file manually

Here is how you make your config.php manually: In your download there should be a wp-config-sample.php. Open this is a text editor. Fill in your database connection details. Go to https://api.wordpress.org/secret-key/1.1/salt/ and get the code. Copy the above cope and paste into the sample file over the top of the existing defines Save the file … Read more

html lang=”” instead of lang=”en-us” – why?

You can apply the language_attributes filter to language_attributes() function (source). Basically you can do this by adding something like this to your functions.php: add_filter(‘language_attributes’, ‘custom_lang_attr’); function custom_lang_attr() { return ‘lang=”en-US”‘; } Note: Keep in mind, that you’re overwriting the language parameter; the original string (see @param) is a space-separated list of language attributes.

enable SFTP via SSH keys in wordpress

For connection through ssh, you have to specify the ssh user using FTP_USER define( ‘FS_METHOD’, ‘ssh’ ); define( ‘FTP_BASE’, ‘/home/user/wordpress’ ); define( ‘FTP_PUBKEY’, ‘/home/user/.ssh/id_rsa.pub’ ); define( ‘FTP_PRIKEY’, ‘/home/user/.ssh/id_rsa’ ); define( ‘FTP_USER’, ‘user’ ); define( ‘FTP_HOST’, ‘localhost:22’ ); I think you also need to define FTP_BASE. You also need to enable ssh upgrade access. From the … Read more

Get WP CLI to hide debug warnings and notices in JSON output, same setting as website

A quick manual solution is to direct all error output to a log file somewhere or even to /dev/null. With your command this would look like this: wp plugin list –fields=name,status,update,version,update_version,title –format=json 2> ./cli-command.err.log If you totally don’t care about the errors, warnings and notices, you could send it to /dev/null like this: wp plugin … Read more

wp-config.php being deleted

The problem turned out to be that wp-config was infected with some sort of code. Typical of what you see at the top of infected .php files. I have cxs running on the server and it was, quite rightly, detecting the malicious (I assume) code and quarantining the file. When I restored the file, because … Read more

Including a 3rd party library in WordPress which needs to be accessible by wp-config

1st, the key should be generated once, not per request. The tutorial is suggesting you generate it via the library (probably via cli, or one off script you run in the browser) and then simple add: define(‘JOSH_ENCRYPT_KEY’, ‘the-random-key-you-generated-gets-copy-pasted-in-here-manually’); into your wp-config.php file, so you dont need the lib to be in scope at that point. … Read more

Set wp-content folder to Dropbox folder

You will need to create an alias to your Dropbox folder so those files can be accessed on your server. This can be done in httpd.conf: Alias /dropbox /Users/seth/Dropbox Or you could make a direct alias to the real wp-content folder: Alias /wp-content /Users/seth/Dropbox/Xammp-Content/wordpress/wp-content/ Then set WP_CONTENT_URL in wp-config.php appropriately: define( ‘WP_CONTENT_URL’, ‘http://localhost/dropbox/Xammp-content/wordpress/wp-content’ );

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