Changing the default Mediawiki logo
Mediawiki comes with no logo or icon by default. Changing this is a simple procedure, only requiring a quick change in LocalSettings.php.
What you need to know
- You will need the pictures of the logo that you want to use.
- The Logo picture must be 150x150 pixels.
- The Icon picture must be 32x32 pixels.
- They must both be in the PNG format.
- You will also need to know the location of the pictures on your server or the web, or copy them to your Mediawiki directory.
Changing the Mediawiki logo
- Browse to your Mediawiki directory in the web server folder. You'll want to edit LocalSettings.php with KWrite.
- Press Ctrl+F to open the find bar down the bottom of KWrite.
- Type 'Logo' into the find box. This should highlight '$wgLogo'. If not, click Next until it does.
- In the quote marks, there is a path. This needs to be changed to whereever your logo is stored.
- If you moved your logo picture to the Mediawiki folder, you can use "$wgScriptPath/file.png".
- If you have the file elsewhere on the computer, type the full path from /, for example "/root/Pictures/file.png". This method is more tricky, the web user needs permissions to read the foder with the picture in.
- If you want to use an uploaded picture on Mediawiki itself, you will need the full web path to the picture that you want to use. Type this path in the quotes.
- Depending on what method you used, you should have one of the following in LocalSettings.php:
$wgLogo = "$wgScriptPath/file.png";
or$wgLogo = "/root/Pictures/file.png";
or$wgLogo = "http://www.example.com/wiki/images/7/76/logo.png";
- Go to your Mediawiki site and check for the logo has changed to your choosing. That should be it!
Changing the Mediawiki icon
This is also known as the Favicon. It appears as the icon when you bookmark the page and on modern browsers, is usually displayed to the left of the address bar. This is changed in a similar method to the logo. The line is not already in LocallSettings.php however and must be added.
- Browse to your Mediawiki directory in the web server folder. You'll want to edit LocalSettings.php with KWrite.
- Goto the line you just edited for your logo. Press return to type a new line underneath.
- Type the following:
$wgFavicon="$wgScriptPath/favicon.png";
- Read above about changing the logo for the different variations on where the file can be and what to type. The same rules apply here
- Go to your Mediawiki site and check for the favicon has changed to your choosing. Check left of the address bar in a modern browser or try bookmarking the page, see if the icon changes.
Troubleshooting
- Lines in LocalSettings.php must end with a ; - don't forget to put that in or it could stop your wiki from working!!!
- Make sure the images are the correct sizes to avoid problems (check 'What you need to know' at the top of this article)
- Remember, PNG may only display in more modern browsers. If either feature is not showing up and you know your settings are right, consider using a newer browser.
Related pages
External references
Mediawiki FAQ, How do I change the logo?
Mediawiki FAQ, How do I change the icon in the browser's address line (favicon)?