- Go to
Admin > Stores > All Stores
- Click >
Create Web Site
- In the Name field, enter store name.
- e.g.
Japan
- e.g.
- In the Code field, enter a unique string without spaces and >
Save Web Site
- e.g.
super_jp
- e.g.
- Create Store
- Create Store View
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* @ http://stackoverflow.com/a/12628971 */ | |
function isValidUrl($url){ | |
// first do some quick sanity checks: | |
if(!$url || !is_string($url)){ | |
return false; | |
} | |
// quick check url is roughly a valid http request: ( http://blah/... ) | |
if( ! preg_match('/^http(s)?:\/\/[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(\/.*)?$/i', $url) ){ | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
1) upload this file into the folder you'd like to extract the content of the downloaded .zip file. | |
2) run the script in you browser. i.e. http://localhost/downunzip.php | |
3) after the script was executed sucesfully, login thru ftp and remove this script | |
*/ | |
/* you can change this */ | |
$download_url = "https://wordpress.org/latest.zip"; // url to zip file you want to download | |
$delete = "no"; // if you DO NOT want the .zip file to be deleted after it was extracted set "yes" to "no". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
// ***************************************** // | |
// ********** DECLARE VARIABLES ********** // | |
// ***************************************** // | |
$username = 'username'; | |
$password = 'password'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* code below goes in your functions.php theme file. | |
*/ | |
// changing the wp-login.php?action=lostpassword to /lost-password/ | |
function custom_lost_password_page() { | |
return home_url('/lost-password/'); | |
} | |
add_filter('lostpassword_url', 'custom_lost_password_page'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // copy & paste the code below in your functions.php file, change the title and href and save it. | |
function add_link_to_adminbar($wp_admin_bar){ | |
$args = array( | |
'id' => 'custom-link', | |
'title' => 'Custom Button Title', | |
'href' => 'http://example.org/', | |
'meta' => array( | |
'class' => 'custom-link-class' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// With this function you can check response code if it really is 404 or nah | |
function isValidUrl($url){ | |
// first do some quick sanity checks: | |
if(!$url || !is_string($url)){ | |
return false; | |
} | |
// quick check url is roughly a valid http request: ( http://blah/... ) | |
if( ! preg_match('/^http(s)?:\/\/[a-z0-9-]+(\.[a-z0-9-]+)*(:[0-9]+)?(\/.*)?$/i', $url) ){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = "https://wordpress.org/latest.zip"; // URL of what you wan to download | |
$zipFile = "wordpress.zip"; // Rename .zip file | |
$extractDir = "extracted"; // Name of the directory where files are extracted | |
$zipResource = fopen($zipFile, "w"); | |
// Get The Zip File From Server | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_FAILONERROR, true); |
If you force http to https redirection on your website, while using CloudFlare, with the following normal methods, a loop redirection occurs.
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
Normal Redirect via PHP
NewerOlder