-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtemplate_settings.php
More file actions
42 lines (33 loc) · 1.73 KB
/
template_settings.php
File metadata and controls
42 lines (33 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php $theme = get_option("bootswatch_theme_css_file", "bootswatch_theme"); ?>
<?php $themes = json_decode(file_get_contents(template_dir() . 'css/themes.json'), true);
$other_theme = array("name" => "Bootstra.386", "cssCdn" => template_url('css/styles/bootstra_386/css/bootstrap.css'));
$themes['themes'][] = $other_theme;
$other_theme = array("name" => "Violins", "cssCdn" => template_url('css/styles/violins/style.css'));
$themes['themes'][] = $other_theme;
?>
<script>
$(document).ready(function () {
$('input[type=radio][name=bootswatch_theme_css_file]').change(function () {
if (this.value == '') {
window.parent.$('head link#bootstrap_theme').attr('href', '<?php print template_url() ?>css/default.css');
} else {
window.parent.$('head link#bootstrap_theme').attr('href', this.value);
}
});
});
</script>
<div class="">
<h4>Theme Colors</h4>
<div class="m-t-10">
<label class="mw-ui-check m-b-10 mw-full-width">
<input class="mw_option_field" option-group="bootswatch_theme" type="radio" <?php if ($theme == ''): ?> checked="" <?php endif; ?> name="bootswatch_theme_css_file" value="">
<span></span><span>Default</span>
</label>
<?php foreach ($themes['themes'] as $item): ?>
<label class="mw-ui-check m-b-10 mw-full-width">
<input class="mw_option_field" option-group="bootswatch_theme" type="radio" <?php if ($theme == $item['cssCdn']): ?> checked="" <?php endif; ?> name="bootswatch_theme_css_file" value="<?php print $item['cssCdn'] ?>">
<span></span><span><?php print $item['name'] ?></span>
</label>
<?php endforeach; ?>
</div>
</div>