After setting up multisite on localhost, requests to localhost redirect to production domain

OK. I figured it out: When moving to multisite, manually overriding WP_HOME and WP_SITEURL like below doesn’t work anymore: // Overwrites the database to save from constantly editing the DB define(‘WP_HOME’,’http://localhost’); define(‘WP_SITEURL’,’http://localhost/wp’); I fixed this by manually changing the database so WP_HOME is http://localhost and WP_SITEURL is http://localhost/wp.

WordPress File Structure

You probably want to create a Page. In that Page’s edit screen, just below the title, you can see the URL that Page can be found at, something like http://country.com/france/ “france” is the slug of that Page, and is highlighted yellow indicating you can edit it. That way the Page can be called “I Love … Read more

Let users edit their role from the frontend

You could make a widget that updates the role: Widget has a drop down select input Select input submits a Ajax call to backend Backend Ajax call processor updades the user meta Pass the User ID along with the role ID Update user meta with update_user_meta( $user_id, $meta_key, $meta_value, $prev_value )

get_template_directory() returns wrong address on VPS

You can read data on your server with file_get_contents(). If you want to make sure the file exists and is readable then use is_readable(). You don’t really need to use trailingslashit() in this case because you’re constructing the URI yourself. // path to file under current theme $json_file = get_template_directory() . ‘/inc/includes/acf-fonticonpicker/icons/selection.json’; // make sure … Read more

For what is the “.well-known”-folder?

That /.well-known/ subdirectory is defined by RFC 5785 RFC 8615 It is increasingly common for Web-based protocols to require the discovery of policy or other information about a host (“site-wide metadata”) before making a request. For example, the Robots Exclusion Protocol http://www.robotstxt.org/ specifies a way for automated processes to obtain permission to access resources; likewise, … Read more

How to visit php file in my custom directory under site root directory

Only Apache is “responsible for caring” that your script is PHP. AFAIK, whether you need to use AddHandler or AddType depends on whether your PHP is installed as a module or as CGI. You can try creating .htaccess in wp-mybiz/ folder containg some of the common solutions/workarounds 1) AddType application/x-httpd-php .php 2a) AddHandler application/x-httpd-php .php … Read more