forked from jchristopher/Franklin-Street-Theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·59 lines (58 loc) · 2.73 KB
/
index.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
<?php
/**
* @package Frank
*/
?>
<?php get_header(); ?>
<main id="content" class="home" role="main">
<?php
$frank_sections = get_option( '_frank_options' );
$frank_sections = $frank_sections['sections'];
global $frank_section_type, $frank_section_header, $frank_section_title, $frank_section_caption, $frank_section_num_posts, $frank_section_categories;
if ( $frank_sections ) {
foreach ( $frank_sections as $section ) {
$frank_section_type = $section['display_type'];
$frank_section_header = $section['header'];
$frank_section_title = $section['title'];
$frank_section_caption = $section['caption'];
$frank_section_num_posts = $section['num_posts'];
$frank_section_categories = $section['categories'];
$frank_paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
/* TODO: Clean this up */
switch ( $frank_section_type ) {
case 'srd_loop':
$wp_query = new WP_Query( array( 'posts_per_page' => $frank_section_num_posts, 'cat' => implode( ',', array_filter( $frank_section_categories ) ), 'paged' => $frank_paged ) );
get_template_part( 'partials/loops/loop', 'srd' );
break;
case 'one_up_reg':
$wp_query = new WP_Query( array( 'posts_per_page' => $frank_section_num_posts, 'cat' => implode( ',', array_filter( $frank_section_categories ) ), 'paged' => $frank_paged ) );
get_template_part( 'partials/loops/loop', 'oneup' );
break;
case 'one_up_lg':
$wp_query = new WP_Query( array( 'posts_per_page' => $frank_section_num_posts, 'cat' => implode( ',', array_filter( $frank_section_categories ) ), 'paged' => $frank_paged ) );
get_template_part( 'partials/loops/loop', 'oneuplarge' );
break;
case 'two_up':
$wp_query = new WP_Query( array( 'posts_per_page' => $frank_section_num_posts, 'cat' => implode( ',', array_filter( $frank_section_categories ) ), 'paged' => $frank_paged ) );
get_template_part( 'partials/loops/loop', 'twoup' );
break;
case 'three_up':
$wp_query = new WP_Query( array( 'posts_per_page' => $frank_section_num_posts, 'cat' => implode( ',', array_filter( $frank_section_categories ) ), 'paged' => $frank_paged ) );
get_template_part( 'partials/loops/loop', 'threeup' );
break;
case 'four_up':
$wp_query = new WP_Query( array( 'posts_per_page' => $frank_section_num_posts, 'cat' => implode( ',', array_filter( $frank_section_categories ) ), 'paged' => $frank_paged ) );
get_template_part( 'partials/loops/loop', 'fourup' );
break;
default :
get_template_part( 'partials/loops/loop' );
}
}
} else {
//Insert default loop
get_template_part( 'partials/loops/loop' );
}
?>
<?php get_template_part( 'partials/post-pagination' ); ?>
</main>
<?php get_footer(); ?>