Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 1 commit
  • 2 files changed
  • 0 comments
  • 1 contributor
Aug 17, 2012
Benjamin shit 536d93a
36  home-eventPost.php
... ...
@@ -0,0 +1,36 @@
  1
+<?php 
  2
+//look to see if images are attached to the post
  3
+//if not the post needs to be styled differently
  4
+	$has_attachments;
  5
+	$args = array(
  6
+	   'post_type' => 'attachment',
  7
+	   'numberposts' => -1,
  8
+	   'post_status' => null,
  9
+	   'post_parent' => $post->ID
  10
+	  );
  11
+	  $attachments = get_posts( $args );
  12
+	     if ( $attachments ) {
  13
+	        $has_attachments = true;
  14
+	     } else {
  15
+	     	$has_attachments = false;
  16
+	     }
  17
+ ?>
  18
+<div class="article <?php echo($has_attachments ? 'image' : 'no-image'); ?>">
  19
+	<?php if(get_post_type() != 'post') { ?>
  20
+	<h2 class="post-title"><?php the_title(); ?></h2>
  21
+	<?php } ?>
  22
+	<div class="summary">
  23
+		<?php echo $post->post_content; ?>
  24
+		<?php edit_post_link( __( 'Edit', 'Translator' ), '<span class="edit-link">', '</span>' ); ?>
  25
+	</div>
  26
+	<div class="event-info">
  27
+		<div class="date-time">
  28
+			<h3 class="date"><?php echo get_post_meta(get_the_id(), '_event_date', true); ?></h3>
  29
+			<p class="time">
  30
+				<?php echo get_post_meta(get_the_id(), '_event_start_time', true) . ' - ' . get_post_meta(get_the_id(), '_event_end_time', true); ?>
  31
+			</p>
  32
+		</div>
  33
+
  34
+		<p class="location"><?php echo get_post_meta(get_the_id(), '_location', true); ?></p>
  35
+	</div>
  36
+</div>
11  loop-custom.php
@@ -48,7 +48,16 @@
48 48
 			</div>
49 49
 			<div id="contetnt<?php the_ID(); ?>" class="collapsable content">
50 50
 				<?php $more = 0; ?>
51  
-				<?php get_template_part('content', 'home'); ?>
  51
+				<?php 
  52
+					switch ($post->post_type) {
  53
+						case 't_event':
  54
+							get_template_part('home', 'eventPost');
  55
+							break;
  56
+						default:
  57
+							get_template_part('content', 'home');
  58
+							break;
  59
+					}
  60
+				?>
52 61
 			</div>
53 62
 		</div>
54 63
 	</div>

No commit comments for this range

Something went wrong with that request. Please try again.