summaryrefslogtreecommitdiff
path: root/inc/theme-settings.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/theme-settings.php')
-rwxr-xr-xinc/theme-settings.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/inc/theme-settings.php b/inc/theme-settings.php
new file mode 100755
index 0000000..9bee616
--- /dev/null
+++ b/inc/theme-settings.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Check and setup theme's default settings
+ *
+ * @package understrap
+ *
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly.
+}
+
+if ( ! function_exists ( 'understrap_setup_theme_default_settings' ) ) {
+ function understrap_setup_theme_default_settings() {
+
+ // check if settings are set, if not set defaults.
+ // Caution: DO NOT check existence using === always check with == .
+ // Latest blog posts style.
+ $understrap_posts_index_style = get_theme_mod( 'understrap_posts_index_style' );
+ if ( '' == $understrap_posts_index_style ) {
+ set_theme_mod( 'understrap_posts_index_style', 'default' );
+ }
+
+ // Sidebar position.
+ $understrap_sidebar_position = get_theme_mod( 'understrap_sidebar_position' );
+ if ( '' == $understrap_sidebar_position ) {
+ set_theme_mod( 'understrap_sidebar_position', 'right' );
+ }
+
+ // Container width.
+ $understrap_container_type = get_theme_mod( 'understrap_container_type' );
+ if ( '' == $understrap_container_type ) {
+ set_theme_mod( 'understrap_container_type', 'container' );
+ }
+ }
+} \ No newline at end of file