Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $citySize = array(
- 'key' => '_bm_min_city',
- 'value' => array(50000,100000),
- 'compare' => 'BETWEEN',
- 'type' => 'numeric'
- );
- $investemntRange = array(
- 'key' => '_bm_start_costs',
- 'value' => 10000,
- 'compare' => '<',
- 'type' => 'numeric'
- );
- function bm_release_the_frannies($citySize, $investemntRange){
- global $post;
- $args = array(
- 'post_type' => 'cpt_franchize',
- 'meta_query' => array(
- $citySize,
- $investemntRange
- )
- );
- $results = new WP_Query($args);
- if ( $results->have_posts() ) : while ( $results->have_posts() ) : $results->the_post();
- $bm_cost_licens = get_post_meta($post->ID, '_bm_cost_licens', true);
- $bm_cost_venue = get_post_meta($post->ID, '_bm_cost_venue', true);
- $bm_cost_merchandise = get_post_meta($post->ID, '_bm_cost_merchandise', true);
- $bm_start_costs = get_post_meta($post->ID, '_bm_start_costs', true);
- $bm_return_invest = get_post_meta($post->ID, '_bm_return_invest', true);
- ?>
- <article>
- <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
- <p>Koszty startowy: <strong><?php echo $bm_start_costs; ?></strong></p>
- <ul>
- <li><?php if (! empty( $bm_cost_licens ) ) {echo $bm_cost_licens;} else { echo 'b.d.'; } ?></li>
- <li><?php if (! empty( $bm_cost_venue ) ) {echo $bm_cost_venue;} else { echo 'b.d.'; } ?></li>
- <li><?php if (! empty( $bm_cost_merchandise ) ) {echo $bm_cost_merchandise;} else { echo 'b.d.'; } ?></li>
- </ul>
- <p>Szacowany zwrot z inwestycji: <?php if (! empty( $bm_return_invest ) ) {echo $bm_return_invest;} else { echo 'b.d.'; } ?></p>
- </article>
- <?php
- endwhile;
- else:
- echo 'Brak rezultatów w podanym zakresie';
- endif;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement