Change the path where wordpress plugins are uploaded

You can change the Plugins directory using constants defined in wp-config.php: Set WP_CONTENT_DIR to the full local path of this directory (no trailing slash), e.g. define( ‘WP_CONTENT_DIR’, $_SERVER[‘DOCUMENT_ROOT’] . ‘/blog/wp-content’ ); Set WP_CONTENT_URL to the full URI of this directory (no trailing slash), e.g. define( ‘WP_CONTENT_URL’, ‘http://example/blog/wp-content’); Set WP_PLUGIN_DIR to the full local path of … Read more

When moving a WP site, why does wp-admin redirect to old site?

If this is a single WordPress install, there are a couple database entries with your old domain. Specifically, siteurl and home within wp_options. That said, if the dev URL is temporary, you can also set the following two constants in wp-config.php: define(‘WP_HOME’, ‘http://’ . $_SERVER[‘SERVER_NAME’]); define(‘WP_SITEURL’, WP_HOME . “https://wordpress.stackexchange.com/”); Provided that WordPress is installed in … Read more

theme path in javascript file

What you’re looking for is wp_localize_script function. You use it like this when enqueing script wp_register_script( ‘my-script’, ‘myscript_url’ ); wp_enqueue_script( ‘my-script’ ); $translation_array = array( ‘templateUrl’ => get_stylesheet_directory_uri() ); //after wp_enqueue_script wp_localize_script( ‘my-script’, ‘object_name’, $translation_array ); In your style.js, there is going to be: var templateUrl = object_name.templateUrl; …

What’s the difference between get_home_path() and ABSPATH?

They should do the same thing, but under certain conditions, may not. First of all note: that the codex entry description is misleading that wp-admin/includes/file.php must be included in context else calling get_home_path() will lead to calling an undefined function. Regarding the codex entry, Description Get the absolute filesystem path to the root of the … Read more