WordPress Interview Questions and Answers 2

Q1. How will you disable theme and plugin editing in your WordPress admin?

Ans. Adding the following constant will disable theme and plugin editing from within the WordPress admin:

   define(‘DISALLOW_FILE_EDIT’, true);

Q2. How will you prevent automatic update to a plugin which you have modified?

Ans. You can do it by changing the name of the plugin’s directory then activating it again into your WordPress dashboard. Alternatively, you can modify the name of the plugin to achieve the same.

Continue reading

Return a list of sites on the wordpress multisite network

A simple function that returns the list of all wordpress child websites in the network. The code below just shows all the URL and unlinked.

 $blog_list = get_blog_list( 0, 'all' );
 foreach ($blog_list AS $blog)
     echo 'Blog '.$blog['blog_id'].': '.$blog['domain'].$blog['path'].'<br />';

and you’re all done !!

404 error in accessing child theme in wordpress multisite

If you are using IIS Server and need to install wordpress multisite. Click here for the installation process.

After installing the multisite when you create a child theme, there might be a problem you are getting 404 error. It means the path you are trying to access on your web browser is not able to redirect to the specified directory. It is the problem for redirection. In this case just update your web.config if you are using the Windows IIS Server or update the .htaccess file if you are using the apache/linux Server.

Code for web.config file:

<?xml version="1.0" encoding="UTF-8"?>
                <rule name="WordPress Rule 1" stopProcessing="true">
                    <match url="^index\.php$" ignoreCase="false" />
                    <action type="None" />
                <rule name="WordPress Rule 2" stopProcessing="true">
                    <match url="^([_0-9a-zA-Z-]+/)?files/(.+)" ignoreCase="false" />
                    <action type="Rewrite" url="wp-includes/ms-files.php?file={R:2}" appendQueryString="false" />
                </rule> Continue reading