A favicon is a small icon associated with a website, typically displayed in browser tabs, bookmarks, and shortcut icons. In Osclass, favicons are usually located in two primary locations:
favicon.ico
in the root directory.oc-content/themes/{theme_name}/images/favicons/
, where themes may support different types and sizes of favicons.Osclass installations typically include a default favicon.ico
in the root directory. If a browser cannot find a theme-specific favicon, it will attempt to use this default file.
Most Osclass themes provide a set of favicons inside the theme directory. These are referenced in the theme's header file, usually located in:
oc-content/themes/{theme_name}/header.php
oc-content/themes/{theme_name}/head-favicon.php
(some themes use an include file for head elements)Here is a sample favicon setup from an Osclass theme:
<link rel="shortcut icon" type="image/x-icon" href="https://example.com/oc-content/themes/{theme_name}/images/favicons/favicon.ico" />
<link rel="icon" href="https://example.com/oc-content/themes/{theme_name}/images/favicons/favicon-16x16.png" sizes="16x16" type="image/png" />
<link rel="icon" href="https://example.com/oc-content/themes/{theme_name}/images/favicons/favicon-32x32.png" sizes="32x32" type="image/png" />
<link rel="apple-touch-icon" sizes="180x180" href="https://example.com/oc-content/themes/{theme_name}/images/favicons/apple-touch-icon.png" />
Create or obtain favicons in various sizes. Recommended sizes include:
favicon.ico
(16x16 or 32x32, ICO format)favicon-16x16.png
(16x16 PNG format)favicon-32x32.png
(32x32 PNG format)apple-touch-icon.png
(180x180 PNG format for iOS devices)You can generate these using online tools such as Real Favicon Generator.
Upload your new favicon files to the theme's favicon folder:
oc-content/themes/{theme_name}/images/favicons/
Ensure the filenames match those referenced in your theme’s header file.
For a global change, replace the default favicon.ico
in the root folder:
/public_html/favicon.ico
Note that some browsers cache favicons, so changes may not appear immediately.
If necessary, edit the theme’s header file (header.php
or inc/head.php
) to reference your new favicon paths.
<link rel="icon" href="{your-new-favicon-path}" type="image/png" sizes="32x32" />
If you are using PWA Plugin to get your PWA application working, this plugin use custom set of favicons. Go to Plugins > PWA Plugin > Configure and upload/setup your new favicons here. Then make sure to re-build Manifest.json and Service workers as well.
To see your changes immediately:
Note: It may take some time (days/weeks) to get new favicon into your browser and even more to see new favicon in Google results!
Use online tools like:
If the new favicon does not appear:
Changing favicons in Osclass involves updating theme-specific favicon files and optionally replacing the root favicon.ico
. Ensuring proper placement and clearing cache will help the new favicon appear correctly.