Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Merge pull request #3 from jmr06005/master

Updating list view
  • Loading branch information
jmr06005 committed Nov 22, 2017
2 parents 1640dbe + f8aa591 commit 28138ff17fe0a79f141b7f57339941e0910318a4
Showing with 50 additions and 33 deletions.
  1. +50 −33 templates/archive-programs.php
@@ -572,12 +572,12 @@ function display($posts = array()){
if($_GET['category'] == 'all'){
foreach($groups as $key=>$group){
if($key == 'all') continue;
echo '<h2 style="clear:left">'.$programTabIDs[$key].'</h2>';
echo '<h2 class="sorting-header">'.$programTabIDs[$key].'</h2>';
display($group);
}
}
else{
echo '<h2 style="clear:left">'.$programTabIDs[$_GET['category']].'</h2>';
echo '<h2 class="sorting-header">'.$programTabIDs[$_GET['category']].'</h2>';
display($posts);
}
?>
@@ -592,6 +592,10 @@ function display($posts = array()){
<!-- Grid End -->
<!-- List Start -->
<div class="tab-pane" id="tab2">
<?php if(!empty($posts)):
function displayList($posts = array()){
global $programs;
?>
<ol class="program-list-view" >
<li class="program-list <?php if($tags){ foreach($tags as $tag){echo ' '.strtolower(str_replace($search, $replace, $tag->name));} } ?>">
<ul id="badge-list" class="program-headers">
@@ -611,42 +615,55 @@ function display($posts = array()){
</li>
</ul>
</li>
<?php if(!empty($posts)): foreach($posts as $post): setup_postdata($post); ?>
<?php $tags = get_the_tags();
$search = array(" ", "/");
$replace = array("", "-");
$terraid = get_post_meta( get_the_ID(), 'apply-link', true );
$terraid = explode('Program_ID=',$terraid);
$terraid = explode('&',$terraid[1]);
$terraid = $terraid[0];?>
<li class="program-list <?php if($tags){ foreach($tags as $tag){echo ' '.strtolower(str_replace($search, $replace, $tag->name));} } ?>">
<ul id="badge-list">
<a href="<?php the_permalink() ?>">
<li class="list-img">
<?php the_post_thumbnail('thumbnail');?>
</li>
<li class="list-title">
<?php the_title(); ?>
</li>
<li class="list-city">
<?php echo $programs[$terraid]->PROGRAM_CITY;//$key="program-city"; echo get_post_meta($post->ID, $key, true); ?>
</li>
<li class="list-country">
<?php echo $programs[$terraid]->PROGRAM_COUNTRY;//$key="program-country"; echo get_post_meta($post->ID, $key, true); ?>
</li>
<li class="list-region">
<?php echo $programs[$terraid]->PROGRAM_REGION;//$key="program-region"; echo get_post_meta($post->ID, $key, true); ?>
</li>
</a>
</ul>
</li>
<?php endforeach?>
<?php
foreach($posts as $post){ ?>
<?php $tags = get_the_tags($post->ID);
$search = array(" ", "/");
$replace = array("", "-");
$terraid = get_post_meta( $post->ID, 'apply-link', true );
$terraid = explode('Program_ID=',$terraid);
$terraid = explode('&',$terraid[1]);
$terraid = $terraid[0];?>
<li class="program-list <?php if($tags){ foreach($tags as $tag){echo ' '.strtolower(str_replace($search, $replace, $tag->name));} } ?>">
<ul id="badge-list">
<a href="<?php echo get_the_permalink($post->ID) ?>">
<li class="list-img">
<?php echo get_the_post_thumbnail($post->ID, 'thumbnail');?>
</li>
<li class="list-title">
<?php echo get_the_title($post->ID); ?>
</li>
<li class="list-city">
<?php echo $programs[$terraid]->PROGRAM_CITY;//$key="program-city"; echo get_post_meta($post->ID, $key, true); ?>
</li>
<li class="list-country">
<?php echo $programs[$terraid]->PROGRAM_COUNTRY;//$key="program-country"; echo get_post_meta($post->ID, $key, true); ?>
</li>
<li class="list-region">
<?php echo $programs[$terraid]->PROGRAM_REGION;//$key="program-region"; echo get_post_meta($post->ID, $key, true); ?>
</li>
</a>
</ul>
</li>
<?php }
echo '</ol>';
} // end function displayList
if($_GET['category'] == 'all'){
foreach($groups as $key=>$group){
if($key == 'all') continue;
echo '<h2 class="sorting-header">'.$programTabIDs[$key].'</h2>';
displayList($group);
}
}
else{
echo '<h2 class="sorting-header">'.$programTabIDs[$_GET['category']].'</h2>';
displayList($posts);
}?>
<?php else: ?>
<p>
<?php _e('Sorry, no exchange programs are listed.'); ?>
</p>
<?php endif; ?>
</ol>
</div>
<!-- List End -->
</div>

0 comments on commit 28138ff

Please sign in to comment.
You can’t perform that action at this time.