Can a function inside the functions.php file call another function from within functions.php? I'm guessing yes and which is why I wrote the code below, but it doesn't work for some reason. Can anyone please check it out and help me.
I tried calling pageBarColor() from register_sidebar()
Thanks.
<?php
if (function_exists('register_sidebar')) {
register_sidebar(array(
'before_widget' => '<li class="sidebarModule">',
'after_widget' => '</li><!-- end module -->',
'before_title' => '<h2 class="moduleTitle '.pageBarColor().'">',
'after_title' => '</h2>',
));
}
function pageBarColor(){
if(is_category('3')) {
return "color1";
} elseif(is_category('4')) {
return "color2";
} elseif(is_category('5')) {
return "color3";
} elseif(is_category('6')) {
return "color4";
} elseif(is_category('7')) {
return "color5";
}
}
?>