This repository was archived by the owner on Jan 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate-case-history.php
More file actions
71 lines (57 loc) · 2.58 KB
/
template-case-history.php
File metadata and controls
71 lines (57 loc) · 2.58 KB
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
/**
* Template Name: Case History
* Description: Used as a page template to show page contents, followed by the Case History
* through the "Case Histories" CPTs
*/
// Enque scripts
wp_enqueue_script('jquery-ui-accordion');
wp_enqueue_script( 'toggle-accordion', get_bloginfo( 'stylesheet_directory' ) . '/js/toggle-accordion.init.js', array( 'jquery-ui-accordion' ), CHILD_THEME_VERSION );
wp_enqueue_script( 'colorbox', get_bloginfo( 'stylesheet_directory' ) . '/js/jquery.colorbox-min.js', array( 'jquery' ), CHILD_THEME_VERSION );
wp_enqueue_script( 'colorbox-init', get_bloginfo( 'stylesheet_directory' ) . '/js/colorbox-init.js', array( 'colorbox' ), CHILD_THEME_VERSION );
// Add our custom loop
//remove_action('genesis_loop','genesis_do_loop'); //remove if the default content is not neede
add_action('genesis_loop','sax_case_history');
function sax_case_history() {
global $post;
// arguments, adjust as needed
$args = array(
'post_type' => 'case-history',
'posts_per_page' => -1,
'order' => 'ASC',
);
/*
Overwrite $wp_query with our new query.
The only reason we're doing this is so the pagination functions work,
since they use $wp_query. If pagination wasn't an issue,
use: https://gist.github.com/3218106
*/
global $wp_query;
$wp_query = new WP_Query( $args );
if ( have_posts() ) :
echo '<div class="entry entry-case-history">';
echo '<div id="accordion">';
while ( have_posts() ) : the_post();
$data_accadimento = genesis_get_custom_field('wpcf-data-accadimento');
$importo_anticipo_indennizzo = genesis_get_custom_field( 'wpcf-importo-anticipo-indennizzo' );
$data_anticipo_indennizzo = genesis_get_custom_field( 'wpcf-data-anticipo-indennizzo' );
$importo_liquidato = genesis_get_custom_field( 'wpcf-importo-liquidato' );
$data_liquidazione = genesis_get_custom_field( 'wpcf-data-liquidazione' );
?>
<h3 class="trigger"><a href="#"><?php the_title(); ?></a></h3>
<div class="toggle_container">
<ul>
<li><?php echo do_shortcode('[gallery type="rectangular" link="file" orderby="rand"]');//the_post_thumbnail ('medium'); ?></li>
<li>Data accadimento: <span><?php echo $data_accadimento; ?></li>
<li>Importo anticipo indennizzo: <span><?php echo $importo_anticipo_indennizzo; ?></li>
<li>Data anticipo indennizzo: <span><?php echo $data_anticipo_indennizzo; ?></li>
<li>Importo liquidato: <span><?php echo $importo_liquidato; ?></li>
<li>Data liquidazione: <span><?php echo $data_liquidazione; ?></li>
</div>
<?php endwhile;
echo '</div></div>';
do_action( 'genesis_after_endwhile' );
endif;
wp_reset_query();
}
genesis();