Project

General

Profile

Support #4023 » template-home.php

themes/arab-stages/template-home.php - Alex Hills, 2015-04-26 01:32 PM

 
1
<?php
2
/**
3
 * Template Name: ES Home Page
4
 *
5
 * This is a custom Page template for displaying the ES home page.
6
 * It will display a slider of selected images and titles and authors of current articles.
7
 *
8
 * @package Thematic
9
 * @subpackage Templates
10
 *
11
 */
12

    
13
	// calling the header.php
14
	get_header();
15

    
16
	// action hook for placing content above #container
17
	thematic_abovecontainer();
18
?>
19

    
20
		<div id="container" class="home">
21

    
22
			<?php
23

    
24
				// filter for manipulating the element that wraps the content 
25
				echo apply_filters( 'thematic_open_id_content', '<div id="content">' . "\n\n" );
26

    
27
				// calling the widget area 'page-top'
28
            	get_sidebar('page-top');
29

    
30
				// start the loop to get the page content
31
				the_post();
32

    
33
			?>
34

    
35
				<div id="post-<?php the_ID(); ?>" <?php post_class(); ?> > 
36

    
37
					<div class="entry-content">
38
						<?php
39
						$images = get_field('image_gallery');
40
						if( $images ):
41
							$numberOfImages = count($images);
42
							$galleryWidth = $numberOfImages*100;
43
							$itemWidth = 100/$numberOfImages;
44
							?>
45
							<div class="theWholeGallery">
46
								<ul class="imageGallery" style="width:<?php echo $galleryWidth; ?>%;">
47
									<?php foreach( $images as $image ): ?>
48
										<li style="width:<?php echo $itemWidth; ?>%" id="image<?php echo $image['id']; ?>">
49
											<a href="<?php echo $image['description'];?>">
50
												<img src="<?php echo $image['url']; ?>">
51
											</a>
52
											<div clas="erHomeText">
53
												<div id="erHomeTitle" class="erdynamicText">
54
													<a href="<?php echo $image['description'];?>"><?php echo $image['title'];?></a>
55
												</div>
56
												<div id="erHomeDesc" class="erdynamicText">
57
													<?php echo $image['caption'];?>
58
												</div>
59
											</div>
60
										</li>
61
									<?php endforeach; ?>
62
									<br clear="all">
63
								</ul>
64
								<div class="theDots">
65
									<ul>
66
										<?php foreach( $images as $image ): ?>
67
											<li id="image<?php echo $image['id']; ?>"></li>
68
										<?php endforeach; ?>
69
									</ul>
70
									<br clear="all">
71
								</div>
72
							</div>
73
						<?php endif; ?>
74
	                    <?php 
75
	                    	// displays the "Page" content 
76
	                    	the_content();
77
	
78
							// action hook for issue table of contents
79
							ES_issue_contents();
80

    
81
	                    ?>
82

    
83
					</div><!-- .entry-content -->
84

    
85
				</div><!-- #post -->
86

    
87
	        <?php
88
					
89
	       		// action hook for placing contentbelow #post
90
	       		thematic_belowpost();
91

    
92
       			// action hook for calling the comments_template
93
       			thematic_comments_template();
94
	        ?>
95

    
96
			</div><!-- #content -->
97

    
98
			<?php 
99
				// action hook for placing content below #content
100
				thematic_belowcontent();
101
			?> 
102

    
103
		</div><!-- #container -->
104

    
105
<?php 
106
	// action hook for placing content below #container
107
	thematic_belowcontainer();
108

    
109
	// calling the standard sidebar 
110
	thematic_sidebar();
111

    
112
	// calling footer.php
113
	get_footer();
114
?>
(1-1/3)