WP-CLI methods for get_current_blog_id, get_blog_details or $wpdb->prefix
WP-CLI methods for get_current_blog_id, get_blog_details or $wpdb->prefix
WP-CLI methods for get_current_blog_id, get_blog_details or $wpdb->prefix
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
You can do this by adding some code to wp-config.php $request_uri = $_SERVER[‘REQUEST_URI’]; $debug_dirs = array (‘/debug-dir1/’,’/debug-dir2/’); // list of directories to turn on debugging foreach ($debug_dirs as $debug_dir) { if (!strncmp($request_uri,$debug_dir,strlen($debug_dir))) { define(‘WP_DEBUG’, true); } } define(‘WP_DEBUG’, false); // debug off by default
If you installed WordPress Multisite starting with version 3.0 to 3.4.2, you’ve got the correct .htaccess file contents. However, if you started with a newer version (3.5 or higher)—and I’m assuming you did, if you’ve just installed WordPress Multisite recently—your .htaccess file should look like this: RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] # … Read more
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.
After spending the entire day working on this, I finally found a guide that worked perfectly: https://theblogpress.com/blog/seeing-weird-characters-on-blog-how-to-fix-wordpress-character-encoding-latin1-to-utf8/ Before that, I tried following @Rarst’s information, tried exporting the database and manually cleaning it, tried the UTF-8 Sanitize Plugin with a modified version from here http://www.prelovac.com/vladimir/ultimate-solution-to-weird-utf-character-encoding-problem (which actually worked pretty well, but didn’t fix all the characters. … Read more
Here’s what worked for me: My Hostgator WordPress site was throwing the same error until I commented out the top-level .htaccess file. Like so: My website is a subdomain, so it had it’s own .htaccess, so that’s where the php version was specified (cpanel did this automatically). I didn’t have to edit wp-config.php or anything … Read more
Why do you need this? In wp-config you can set defines. They will be accesible everywhere without needing to use globals. Define something: define(‘MY_DEFINE_NAME’, ‘THE_VALUE’);. Then in your templates you can show the value like this: echo MY_DEFINE_NAME; Or set the value to a variable: $var = MY_DEFINE_NAME;.
The procedure is thoroughly documented in Codex under Moving a Root install to its own directory. You misunderstand the point about changing URLs in it, and yes the terminology sucks. The only URLs that will change are those that are based on the “WP address”. That would be WordPress core, essentially the admin area. All … Read more
There is, as far as I know, no way to hook into wp-config.php from a Theme. For one, wp-config.php shouldn’t be writeable; for another, wp-config.php is executed well-before a Theme’s functions.php file is parsed. For a great overview of how WordPress boots, have a look at this two-part post by Theme.FM (part 1, part 2) … Read more