diff --git a/boot.php b/boot.php
index 45ac155b9f..b1c378d344 100644
--- a/boot.php
+++ b/boot.php
@@ -922,6 +922,7 @@ function profile_load(&$a, $nickname, $profile = 0) {
/**
* load/reload current theme info
*/
+
$theme_info_file = "view/theme/".current_theme()."/theme.php";
if (file_exists($theme_info_file)){
require_once($theme_info_file);
diff --git a/index.php b/index.php
index e7227962f4..69c224c1aa 100644
--- a/index.php
+++ b/index.php
@@ -258,6 +258,11 @@ if($a->module_loaded) {
$func($a);
}
+ if(function_exists(str_replace('-','_',current_theme()) . '_init')) {
+ $func = str_replace('-','_',current_theme()) . '_init';
+ $func($a);
+ }
+
if(($_SERVER['REQUEST_METHOD'] === 'POST') && (! $a->error)
&& (function_exists($a->module . '_post'))
&& (! x($_POST,'auth-params'))) {
diff --git a/view/theme/darkzero-NS/theme.php b/view/theme/darkzero-NS/theme.php
index 2d3e4fd56e..6c1aa7f125 100644
--- a/view/theme/darkzero-NS/theme.php
+++ b/view/theme/darkzero-NS/theme.php
@@ -11,6 +11,7 @@ $a->theme_info = array(
'extends' => 'duepuntozero',
);
+function darkzero_NS_init(&$a) {
$a->page['htmlhead'] .= <<< EOT
EOT;
+}
\ No newline at end of file
diff --git a/view/theme/darkzero/theme.php b/view/theme/darkzero/theme.php
index 8c4d3e9ac3..bbba3ef740 100644
--- a/view/theme/darkzero/theme.php
+++ b/view/theme/darkzero/theme.php
@@ -12,6 +12,7 @@ $a->theme_info = array(
'extends' => 'duepuntozero',
);
+function darkzero_init(&$a) {
$a->page['htmlhead'] .= <<< EOT
EOT;
+}
\ No newline at end of file
diff --git a/view/theme/duepuntozero/theme.php b/view/theme/duepuntozero/theme.php
index 701fb13491..7b42088e1c 100644
--- a/view/theme/duepuntozero/theme.php
+++ b/view/theme/duepuntozero/theme.php
@@ -1,6 +1,7 @@
theme_info = array();
+function duepuntozero_init(&$a) {
$a->page['htmlhead'] .= <<< EOT
EOT;
+}
diff --git a/view/theme/greenzero/theme.php b/view/theme/greenzero/theme.php
index ceec4dd976..c802024754 100644
--- a/view/theme/greenzero/theme.php
+++ b/view/theme/greenzero/theme.php
@@ -3,6 +3,7 @@ $a->theme_info = array(
'extends' => 'duepuntozero',
);
+function greenzero_init(&$a) {
$a->page['htmlhead'] .= <<< EOT
EOT;
+}
\ No newline at end of file
diff --git a/view/theme/purplezero/theme.php b/view/theme/purplezero/theme.php
index ceec4dd976..b9613027c5 100644
--- a/view/theme/purplezero/theme.php
+++ b/view/theme/purplezero/theme.php
@@ -3,6 +3,7 @@ $a->theme_info = array(
'extends' => 'duepuntozero',
);
+function purplezero_init(&$a) {
$a->page['htmlhead'] .= <<< EOT
EOT;
+}
\ No newline at end of file
diff --git a/view/theme/slack-NS/theme.php b/view/theme/slack-NS/theme.php
index ceec4dd976..a8934d03b2 100644
--- a/view/theme/slack-NS/theme.php
+++ b/view/theme/slack-NS/theme.php
@@ -3,6 +3,7 @@ $a->theme_info = array(
'extends' => 'duepuntozero',
);
+function slack_NS_init(&$a) {
$a->page['htmlhead'] .= <<< EOT
EOT;
+}
\ No newline at end of file
diff --git a/view/theme/slackr/theme.php b/view/theme/slackr/theme.php
index ceec4dd976..78f5d40f05 100644
--- a/view/theme/slackr/theme.php
+++ b/view/theme/slackr/theme.php
@@ -3,6 +3,7 @@ $a->theme_info = array(
'extends' => 'duepuntozero',
);
+function slackr_init(&$a) {
$a->page['htmlhead'] .= <<< EOT
EOT;
+}
\ No newline at end of file