Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavidCramer/92d0b2c3996f40068bd85fadd3104f23 to your computer and use it in GitHub Desktop.
Save DavidCramer/92d0b2c3996f40068bd85fadd3104f23 to your computer and use it in GitHub Desktop.
Facet Page Layout
<?php
if ( ! have_posts() ) {
echo 'Nothing, sorry.';
return;
}
?>
<table>
<thead>
<tr>
<td>Title</td>
<td>Location</td>
<td>Date</td>
<td>Status</td>
</tr>
</thead>
<tbody>
<?php while ( have_posts() ) : the_post(); ?>
<tr>
<td id="jobberdiv1" class="jobbercontent"><a
href="<?php the_permalink(); ?>">
<?php $trimit1 = get_the_title();
$getlength = mb_strlen( $trimit1 );
$thelength = 55;
echo mb_substr( $trimit1, 0, $thelength );
if ( $getlength > $thelength ) {
echo "...";
}
?>
</a></td>
<td id="jobberdiv2"
class="jobbercontent"><?php //echo get_post_meta($post->ID, 'job_location', true);
$trimit = get_post_meta( $post->ID, 'job_location', true );
$getlength = mb_strlen( $trimit );
$thelength = 25;
echo mb_substr( $trimit, 0, $thelength );
if ( $getlength > $thelength ) {
echo "...";
}
?></td>
<td id="jobberdiv3"
class="jobbercontent"><?php echo get_the_date( 'm-Y' ); ?></td>
<td id="jobberdiv4"
class="jobbercontent"><?php echo get_post_meta( $post->ID, 'Status', true ); ?></td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment