Topic Closed
Ando
14 Posts

Hello,

thank you so much for GPeasy! It´s great, pretty and so easy (GPeasy)! I  love it.

I´ve made a site which is running superb. But I´ve got one question:

How can I use a Favicon? I know that there was a answer in this form, but ... well... I dont know which file I should edit?

I´ve got the favicon.ico file in the root. And I use the Light_Texture/Blue Theme. Mmmh... but I dont want to "mess around"... so...

Please, could you help me?

Greetings,

Ando

8 years ago#2755

Josh S.
2K Posts
277K Downloads
16 Themes
18 Plugins

I would edit your theme's template.php file. These are located in the folders /themes/--theme-name--/template.php.

The template.php files are mostly html files with a few php calls interspersed so if you're familiar with html, it should be pretty straight forward. Just add the favicon html in between the <head> tags.

<html>

<head>

..

<link href="http://example.com/myicon.png" rel="icon" type="image/png" />

</head>

 

Note: If you are using a theme that is bundled with gpEasy by default. It would be best ot copy the theme and edit the copied theme instead of using the default theme. Upgrading gpEasy overwrites the default themes including any of the changes you make to them.

8 years ago#2757

milingu
3 Posts

I am creating my own theme and now i will add a favicon.

In the file-structure it ist under:" themes \ my_theme \ images \ favicon.png"

The Link in the head-tags is this: " <link rel="icon" type="image/png" href="images / favicon.png" /> "

But it wont work. What i am doing wrong?

Edited: 7 years ago#4392

jogai
264 Posts

The favicon has to be in your webroot, like http://example.com/myicon.png. Can't find a reference of this, but i'm pretty sure it has to be.

7 years ago#4393

milingu
3 Posts

Thanks for your reply.

You are right jogai, the image file has to be in the root dirctory.

__

The code for the template.php head is this: " <link rel="icon" type="image/png" href="../../favicon.png" /> ".

 

 

 

7 years ago#4400

juergen
1.4K Posts
52.8K Downloads
16 Plugins
design, web development & visual effects

Browsers will automatically look for a favicon.ico in the server root directory. But thats not always feasible, for instance if you host your CMS site for testing purposes in a subdirectory. If you want to tie your favicon.png to the gp|Easy theme you could use this code in the template.php:

<link rel="shortcut icon" type="image/png" href="<?php global $dirPrefix, $page; echo 'http://'.$_SERVER['SERVER_NAME'].$dirPrefix.'/themes/'.$page->theme_name; ?>/favicon.png" />

/edit: If you want this even to work in a secure server environment (https://), use this:

<link rel="shortcut icon" type="image/png" href="<?php global $dirPrefix, $page; echo ($_SERVER['SERVER_PORT'] != 443 ? 'http://' : 'https://').$_SERVER['SERVER_NAME'].$dirPrefix.'/themes/'.$page->theme_name; ?>/favicon.png" />

Edited: 7 years ago#4414

Josh S.
2K Posts
277K Downloads
16 Themes
18 Plugins

You could also use $page->theme_path

<?php

global $page;

echo '<link rel="shortcut icon" type="image/png" href="'.dirname($page->theme_path).'/favicon.png" />';

7 years ago#4430

Topic Closed

 

News

elFinder 2.1.50 in Upcoming Release
12/28/2019

A new release for Typesetter is in the works with a lot of improvements including the ... Read More

Typesetter 5.1
8/12/2017

Typesetter 5.1 is now available for download. 5.1 includes bug fixes, UI/UX improvements, ... Read More

More News

creisi productions

Dienstleistungen von creisi productions, Luzern (Schweiz): * Konzeption, Planung und Erstellung Ihres Internet-Auftritts * Betreuung und Aktualisierung/Pflege Ihrer Website * ...

Find out more about our Provider Spotlight

Log In

  Register