wp-go/internal/theme/theme.go

23 lines
493 B
Go
Raw Permalink Normal View History

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() {
2023-01-26 17:03:41 +00:00
addThemeHookFunc(twentyseventeen.ThemeName, twentyseventeen.Hook)
2023-01-18 15:04:12 +00:00
}
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
}