Last active
December 12, 2015 14:36
-
-
Save mwangepatrick/d6a66d3e8307569d098c to your computer and use it in GitHub Desktop.
Filter repeater using more than one sub fields
This file contains 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
<?php | |
/** | |
* Template Name: Events | |
*/ | |
get_header(); ?> | |
<div id="primary" class="site-content"> | |
<div id="content" role="main"> | |
<h3>'Type 3' images from all events:</h3> | |
<?php | |
//alternative route A: | |
// get repeater field data | |
$repeater = get_field('loan_data_table'); | |
// vars | |
$tempArray = array(); | |
if($repeater!=NULL){ | |
//filter this crazy thing now! | |
foreach( $repeater as $row ) { | |
if($row["amount"]=="1000" && $row["maturity"]=="2"){ | |
?> | |
<li>Post title : <?php echo get_the_title( $row->post_id ); ?></li> | |
<?php | |
} | |
} | |
}else{ | |
echo "empty repeater"; | |
} | |
// | |
// | |
// End of alternative route A: | |
</div> | |
</div><!-- #primary --> | |
<?php get_footer(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment