e107sk.com

Content Category Useful Snippets

Useful Snippets (3 items)

Thursday 30 April 2020

How to rid favicon and use new way on 17 May 2020

 At first, you need to delete favicon.ico file from your root. And check if there is no one in the theme folder.

Then add to your theme class:

e107::link(array('rel'=>"title icon", "type"=>"image/png", "href" => THEME_ABS."images/title-img.png"));
OR
e107::link(array('rel'=>"title icon", "type"=>"image/png", "href" => SITEURL.e_THEME."pure/images/title-img.png"));
 

How to replace VIEWPORT in theme.php on 01 May 2020

With version 2.3.0 you get debug error Please place all theme code inside the theme class.

 Before:

define('VIEWPORT', "width=device-width, initial-scale=1.0");

Now:

e107::meta('viewport', 'width=device-width, initial-scale=1.0');

Theme configuration as shortcodes on 01 May 2020

The way how to use values from theme configuration as shortcodes

In theme_shortcodes.php  file:

function sc_theme_pref($parm) 
{ 

$name = $parm['name'];
if(!isset($name)) 
{
return "";
}
$default = $parm['default'];

$value = $this->themePrefs[$name];

$value = varset($value, $default);

return $value; 

}


Example:

{THEME_PREF: code=header_width&default=container}

code: theme preference name

default: default value if the preference is not set 

Used in:

LandingZero2

Other links

Follow us