This repository has been archived on 2020-05-08. You can view files and clone it, but cannot push or open issues or pull requests.
understrap/inc/theme-settings.php

36 lines
1.0 KiB
PHP
Raw Permalink Normal View History

2017-12-01 13:32:22 +00:00
<?php
/**
* Check and setup theme's default settings
*
* @package understrap
*/
2018-09-10 21:59:04 +00:00
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
2018-11-18 23:27:49 +00:00
if ( ! function_exists( 'understrap_setup_theme_default_settings' ) ) {
2017-12-01 13:32:22 +00:00
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' );
}
}
2018-11-18 23:27:49 +00:00
}