2023-01-18 15:04:12 +00:00
|
|
|
package theme
|
|
|
|
|
|
|
|
import (
|
2023-01-20 11:58:45 +00:00
|
|
|
"github.com/fthvgb1/wp-go/internal/pkg/config"
|
2023-01-18 15:04:12 +00:00
|
|
|
"github.com/fthvgb1/wp-go/internal/theme/twentyseventeen"
|
2023-01-20 11:58:45 +00:00
|
|
|
"github.com/fthvgb1/wp-go/internal/wpconfig"
|
2023-01-18 15:04:12 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func InitThemeAndTemplateFuncMap() {
|
|
|
|
AddThemeHookFunc(twentyseventeen.ThemeName, twentyseventeen.Hook)
|
|
|
|
}
|
2023-01-20 11:58:45 +00:00
|
|
|
|
|
|
|
func GetTemplateName() string {
|
|
|
|
tmlp := config.Conf.Load().Theme
|
|
|
|
if tmlp == "" {
|
|
|
|
tmlp = wpconfig.Options.Value("template")
|
|
|
|
}
|
|
|
|
if !IsTemplateDirExists(tmlp) {
|
|
|
|
tmlp = "twentyfifteen"
|
|
|
|
}
|
|
|
|
return tmlp
|
|
|
|
}
|