-
Notifications
You must be signed in to change notification settings - Fork 2
/
author.php
46 lines (37 loc) · 1.67 KB
/
author.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
<?php
remove_action('genesis_before_post_content', 'genesis_post_info');
remove_action('genesis_after_post_content', 'genesis_post_meta');
remove_action('genesis_post_title', 'genesis_do_post_title');
remove_action('genesis_post_content', 'genesis_do_post_content');
remove_action('genesis_after_post', 'genesis_do_author_box_archive');
add_action( 'genesis_before_loop', 'ec_do_query' );
/** Changes the Query before the Loop */
function ec_do_query() {
global $query_string;
query_posts( wp_parse_args( $query_string, array( 'post_type' => 'hours' ) ) );
}
add_action ( 'genesis_before_loop', 'tt_do_title' );
function tt_do_title() {
echo '<h1>My Hours</h1>';
echo '<div class="hours-head"><span class="hours-gravatar"> </span><span class="hours-work-date">Work Date</span><span class="hours-client">Client</span><span class="hours-work-done">Work Done</span><span class="hours-hours-worked">Hours</span></div>';
}
add_action('genesis_post_content', 'short_post');
function short_post() {
global $post;
if ( has_term( 'invoiced', 'hstatus')) {
$row_color = 'invoiced';
} else {
$row_color = '';
}
echo '<div class="tt-row '.$row_color.'">';
echo '<span class="hours-work-date">'. date_i18n(get_option('date_format') ,strtotime( get_post_meta( $post->ID, 'tt_work_date', TRUE ) ) ) .'</span>';
echo '<span class="hours-client">';
$term_list = wp_get_post_terms($post->ID, 'client');
echo $term_list[0]->name;
//print_r($term_list);
echo '</span>';
echo '<span class="hours-work-done">'. wpautop(get_the_content()) .'</span>';
echo '<span class="hours-hours-worked">'. get_post_meta( $post->ID, 'tt_hours_worked', TRUE ) .'</span>';
echo '</div>';
}
genesis();