Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: benjaminx3000/Translator
base: 8c19fc7697
...
head fork: benjaminx3000/Translator
compare: 536d93a9b6
  • 1 commit
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Commits on Aug 17, 2012
Benjamin shit 536d93a
Showing with 46 additions and 1 deletion.
  1. +36 −0 home-eventPost.php
  2. +10 −1 loop-custom.php
36 home-eventPost.php
View
@@ -0,0 +1,36 @@
+<?php
+//look to see if images are attached to the post
+//if not the post needs to be styled differently
+ $has_attachments;
+ $args = array(
+ 'post_type' => 'attachment',
+ 'numberposts' => -1,
+ 'post_status' => null,
+ 'post_parent' => $post->ID
+ );
+ $attachments = get_posts( $args );
+ if ( $attachments ) {
+ $has_attachments = true;
+ } else {
+ $has_attachments = false;
+ }
+ ?>
+<div class="article <?php echo($has_attachments ? 'image' : 'no-image'); ?>">
+ <?php if(get_post_type() != 'post') { ?>
+ <h2 class="post-title"><?php the_title(); ?></h2>
+ <?php } ?>
+ <div class="summary">
+ <?php echo $post->post_content; ?>
+ <?php edit_post_link( __( 'Edit', 'Translator' ), '<span class="edit-link">', '</span>' ); ?>
+ </div>
+ <div class="event-info">
+ <div class="date-time">
+ <h3 class="date"><?php echo get_post_meta(get_the_id(), '_event_date', true); ?></h3>
+ <p class="time">
+ <?php echo get_post_meta(get_the_id(), '_event_start_time', true) . ' - ' . get_post_meta(get_the_id(), '_event_end_time', true); ?>
+ </p>
+ </div>
+
+ <p class="location"><?php echo get_post_meta(get_the_id(), '_location', true); ?></p>
+ </div>
+</div>
11 loop-custom.php
View
@@ -48,7 +48,16 @@
</div>
<div id="contetnt<?php the_ID(); ?>" class="collapsable content">
<?php $more = 0; ?>
- <?php get_template_part('content', 'home'); ?>
+ <?php
+ switch ($post->post_type) {
+ case 't_event':
+ get_template_part('home', 'eventPost');
+ break;
+ default:
+ get_template_part('content', 'home');
+ break;
+ }
+ ?>
</div>
</div>
</div>

No commit comments for this range

Something went wrong with that request. Please try again.