forked from initLab/initlanesis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.php
58 lines (38 loc) · 1.47 KB
/
home.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
<?php
/** Force the full width layout layout on the Portfolio page */
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'zp_custom_blog_page' );
function zp_custom_blog_page(){
global $post, $paged;
$include = genesis_get_option( 'blog_cat' );
$exclude = genesis_get_option( 'blog_cat_exclude' ) ? explode( ',', str_replace( ' ', '', genesis_get_option( 'blog_cat_exclude' ) ) ) : '';
if ( get_query_var('paged') ) { $paged = get_query_var('paged'); }
elseif ( get_query_var('page') ) { $paged = get_query_var('page'); }
else { $paged = 1; }
//* Arguments
$args = array(
'cat' => $include,
'category__not_in' => $exclude,
'posts_per_page' => genesis_get_option( 'blog_cat_num' ),
'paged' => $paged
);
query_posts( $args );
if ( have_posts() ) : while ( have_posts() ) : the_post();
do_action( 'genesis_before_entry' );
printf( '<article %s>', genesis_attr( 'entry' ) );
// check post format and call template
$format = get_post_format();
get_template_part( 'content', $format );
do_action( 'genesis_after_entry_content' );
//do_action( 'genesis_entry_footer' );
echo '</article>';
do_action( 'genesis_after_entry' );
endwhile;
endif;
//* Genesis navigation
genesis_posts_nav();
//* Restore original query
wp_reset_query();
}
genesis();