forked from pavansolapure/openstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle.php
78 lines (69 loc) · 1.75 KB
/
single.php
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/**
* The Template for displaying all single posts.
*
* @package Openstrap
* @subpackage Openstrap
* @since Openstrap 0.1
*/
get_header(); ?>
<?php
$layout = of_get_option('page_layouts');
$wide_sidebar = of_get_option('wider_sidebar');
$col=9;
$side_bar_to_display = "right";
if(isset($layout)) {
switch($layout) {
case "full-width":
$col=12;
$side_bar_to_display = "none";
break;
case "sidebar-content":
$col = (empty($wide_sidebar)) ? 9 : 8;
//$col=9;
$side_bar_to_display = "left";
break;
case "content-sidebar":
$col = (empty($wide_sidebar)) ? 9 : 8;
//$col=9;
$side_bar_to_display = "right";
break;
case "content-sidebar-sidebar":
case "sidebar-sidebar-content":
case "sidebar-content-sidebar":
$col=6;
$side_bar_to_display = "both";
break;
default:
$col = (empty($wide_sidebar)) ? 9 : 8;
//$col=9;
$side_bar_to_display = "right";
}
}
?>
<?php
if($layout == "sidebar-sidebar-content") {
get_sidebar('left');
get_sidebar();
} else if($layout == "sidebar-content-sidebar" || $layout == "sidebar-content") {
get_sidebar('left');
}
?>
<div class="col-md-<?php echo $col;?>" role="content">
<div id="primary" class="site-content">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'single' ); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</div><!-- #primary -->
</div> <!-- .col-md-<?php echo $col;?> .content -->
<?php
if($layout == "content-sidebar-sidebar") {
get_sidebar('left');
get_sidebar();
} else if($layout == "sidebar-content-sidebar" || $layout == "content-sidebar") {
get_sidebar();
}
?>
<?php get_footer(); ?>