Created
June 27, 2012 03:41
-
-
Save zanematthew/3001237 to your computer and use it in GitHub Desktop.
Separating logic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Snippet from events/index.html.php | |
<!-- Track --> | |
<div class="row"> | |
<h2 class="title"><?= $events->getTrackTitle( $post->ID ); ?></h2> | |
<div class="image-container"> | |
<img src="<?= $tracks->getMapImage( $events->getTrackId( $post->ID ), 'medium' ); ?>" /> | |
</div> | |
</div> | |
<!-- --> | |
<?php | |
// Snippet from events_controller.php | |
public function getTrackTitle( $event_id=null ){ | |
$track_id = get_post_meta( $event_id, 'tracks_id', true ); | |
$post = get_post( $track_id ); | |
if ( $post ) | |
return $post->post_title; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment