This repository has been archived by the owner on Nov 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
page-events.php
executable file
·71 lines (61 loc) · 2.29 KB
/
page-events.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
<?php
/**
* The main template file.
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package Graphene
* @since Graphene 1.0
*/
global $hipoul_settings;
get_header(); ?>
<?php get_events(); ?>
<?php
/* Check if the user selects specific category for the front page */
if ( $hipoul_settings['frontpage_posts_cats'] && ! in_array( 'disabled', $hipoul_settings['frontpage_posts_cats'] ) ) {
global $wp_query;
$cats = array();
$args = array('parent' => get_category_by_slug('events')->term_id);
$categories = get_categories($args);
foreach( $categories as $cat ){
$cats[] = $cat->term_id;
}
// Display the sticky posts first
$stickies = get_option('sticky_posts');
if ( get_query_var( 'paged' ) < 2 && ( $stickies ) ) {
$args = array( 'category__in' => $cats, 'post__in' => $stickies );
query_posts( apply_filters( 'graphene_frontpage_posts_cats_sticky_args', $args ) );
$wp_query->is_home = false;
$wp_query->is_category = false;
$wp_query->is_archive = false;
if ( have_posts() ){
get_template_part( 'loop', 'index' );
}
wp_reset_query();
}
// Display the rest of the posts from the category
$args = array( 'category__in' => $cats, 'paged' => get_query_var( 'paged' ), 'post__not_in' => $stickies );
query_posts( apply_filters( 'graphene_frontpage_posts_cats_args', $args ) );
$wp_query->is_home = false;
$wp_query->is_category = false;
$wp_query->is_archive = false;
}
do_action('graphene_index_pre_loop');
/* Run the loop to output the posts.
* If you want to overload this in a child theme then include a file
* called loop-index.php and that will be used instead.
*/
if ( ! ( is_home() && $hipoul_settings['frontpage_posts_cats'] && ! have_posts() ) ) {
while ( have_posts() ) {
the_post();
get_template_part( 'loop', 'index' );
}
}
/* Posts navigation. */
hipoul_posts_nav();
?>
<?php get_footer(); ?>