-
Notifications
You must be signed in to change notification settings - Fork 0
/
single-project.php
125 lines (103 loc) · 3.69 KB
/
single-project.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?php
/**
* Single content for Project post type
*
* @package Flacso
*/
get_header(); ?>
<div class="col-md-9 col-md-push-3">
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'row' ); ?>>
<header class="entry-header">
<div class="entry-meta entry--general-info">
<?php
// Project status
flacso_the_terms( 'status', '' );
?>
</div>
<?php the_title( '<h1 class="entry-title media-heading">', '</h1>' ); ?>
<div class="entry-meta">
<?php
// Coordenation / Coordernação
$coordination = get_post_meta( $post->ID, 'coordenacao', true );
if ( ! empty ( $coordination ) ) {
printf( '<div class="coordination">' . __( 'Coordination: %1$s', 'flacso' ) . '</div>', $coordination );
}
// Sponsorship / Patrocínio
$sponsorship = get_post_meta( $post->ID, 'patrocinio', true );
if ( ! empty ( $sponsorship ) ) {
printf( '<div class="sponsorship">' . __( 'Sponsorship: %1$s', 'flacso' ) . '</div>', $sponsorship );
}
// Funding / Financiamento
$funding = get_post_meta( $post->ID, 'financiamento', true );
if ( ! empty ( $funding ) ) {
printf( '<div class="funding">' . __( 'Funding: %1$s', 'flacso' ) . '</div>', $funding );
}
// Partnership / Parceria
$partnership = get_post_meta( $post->ID, 'parceria', true );
if ( ! empty ( $partnership ) ) {
printf( '<div class="partnership">' . __( 'Partnership: %1$s', 'flacso' ) . '</div>', $partnership );
}
?>
</div><!-- .entry-meta -->
</header><!-- .entry-header -->
<div class="entry-content">
<?php the_content(); ?>
<?php
/* Program / Project relation */
$args = array (
'post_type' => 'post',
'ignore_sticky_posts' => true,
'posts_per_page' => 5,
'meta_query' => array(
array(
'key' => '_flacso-project-relation',
'value' => $post->ID,
'compare' => 'IN',
),
)
);
$news = new WP_Query( $args );
if( $news->have_posts() ) : ?>
<div class="archive archive--secondary">
<h3 class="archive--secondary__header"><?php _e( 'Latest news about the project', 'flacso' ); ?></h3>
<?php
while( $news->have_posts() ) : $news->the_post();
get_template_part( 'content' );
endwhile; ?>
</div>
<?php wp_reset_postdata(); ?>
<?php endif; ?>
</div><!-- .entry-content -->
<?php
/* Program / Project relation */
$programs = get_post_meta( $post->ID, '_flacso-program-relation', false );
if ( ! empty ( $programs ) ) :
?>
<div class="entry-program">
<?php
foreach ( $programs as $program ) :
$program_links[] = '<a href="' . get_page_link( $program ) . '">' . trim( get_post_field( 'post_title', $program ) ) . '</a>';
endforeach;
printf( __( 'This project belongs to the following programs: %s', 'flacso' ), join( ', ', $program_links ) );
?>
</div>
<?php endif; ?>
<div class="entry-share">
<?php flacso_entry_share(); ?>
</div><!-- .entry-share -->
</article><!-- #post-## -->
<?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
?>
<?php endwhile; // end of the loop. ?>
</main><!-- #main -->
</div><!-- #primary -->
</div><!-- .col-md-# -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>