wp_back/wp-content/themes/simple-theme/blog-posts/blog-telegram.php
2024-05-20 15:37:46 +03:00

153 lines
5.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!--<div class="block-telegram">
<div class="block-telegram__content">
<?=get_field('telegram_text','options');?>
</div>
<a class="btn inverted" href="https://t.me/joinchat/TZvpUlJfAZfdZjuf">Присоединяюсь</a>
</div>-->
<?php
global $post;
$ipoteka = 0;
$banki = 0;
foreach(get_the_tags($post->ID) as $tag) {
if ($tag->name == 'ипотека') {
$ipoteka = 1;
}
if ($tag->name == 'Фин_офферы') {
$banki = 1;
}
if ($tag->name == 'вебмастеру') {
$banki = 1;
}
//echo $tag->name;
}
?>
<?php
// БАНКИ
if ($banki == 1) {
$title_bank = get_field('title_bank', 'options');
if( have_rows('props_bank', 'options') ):
// Loop through rows.
?>
<div class="partner_block">
<?php if ($title_bank) : ?>
<h2><?php echo $title_bank; ?></h2>
<?php endif; ?>
<?php
while( have_rows('props_bank', 'options') ) : the_row();
// Load sub field value.
$name_bank = get_sub_field('name_bank');
$bebefit_bank = get_sub_field('bebefit_bank');
$logo_bank = get_sub_field('logo_bank');
// Do something...
?>
<div class="partner_wrap">
<div class="partner_left">
<?php if ($logo_bank) : ?>
<div class="partner_logo">
<img src="<?php echo $logo_bank; ?>">
</div>
<?php endif; ?>
</div>
<div class="partner_right">
<?php if ($name_bank) : ?>
<div class="partner_name">
<?php echo $name_bank; ?>
</div>
<?php endif; ?>
<div class="partner_actions">
<div>
<span>Комиссионное вознаграждение</span>
<?php if ($bebefit_bank) : ?>
<p>до <?php echo $bebefit_bank; ?> ₽</p>
<?php endif; ?>
</div>
<div class="text-right">
<a class="partner_btn btn w-100 text-center" href="#" target="_blank">Больше офферов</a>
</div>
</div>
</div>
</div>
<?php
// End loop.
endwhile;
?>
</div>
<?php
// No value.
else :
// Do something...
endif;
}
?>
<?php
// ИПОТЕКИ
if ($ipoteka == 1) {
$title_ipoteka = get_field('title_ipoteka', 'options');
if( have_rows('props_ipoteka', 'options') ):
// Loop through rows.
?>
<div class="partner_block">
<?php if ($title_ipoteka) : ?>
<h2><?php echo $title_ipoteka; ?></h2>
<?php endif; ?>
<?php
while( have_rows('props_ipoteka', 'options') ) : the_row();
// Load sub field value.
$year_ipoteka = get_sub_field('year_ipoteka');
$rating_ipoteka = get_sub_field('rating_ipoteka');
$cost_ipoteka = get_sub_field('cost_ipoteka');
$pay_ipoteka = get_sub_field('pay_ipoteka');
$logo_ipoteka = get_sub_field('logo_ipoteka');
// Do something...
?>
<div class="partner_wrap ipoteka">
<div class="partner_top">
<div class="partner_logo">
<?php if ($logo_ipoteka) : ?>
<img src="<?php echo $logo_ipoteka; ?>">
<?php endif; ?>
</div>
<div class="partner_cost">
<?php if ($cost_ipoteka) : ?>
<strong><?php echo $cost_ipoteka; ?></strong> руб.
<?php endif; ?>
</div>
<div class="partner_pay">
<span>Ваша комиссия</span>
<?php if ($pay_ipoteka) : ?>
<p><?php echo $pay_ipoteka; ?> ₽</p>
<?php endif; ?>
</div>
</div>
<div class="partner_bottom partner_actions">
<div>
<?php if ($year_ipoteka) : ?>
<span>Страхуют дома после <?php echo $year_ipoteka; ?> г.</span>
<?php endif; ?>
<?php if ($rating_ipoteka) : ?>
<p>Рейтинг: <strong><?php echo $rating_ipoteka; ?></strong></p>
<?php endif; ?>
</div>
<div class="text-right">
<a class="partner_btn btn w-100 text-center" href="#" target="_blank">Купить полис</a>
</div>
</div>
</div>
<?php
// End loop.
endwhile;
?>
</div>
<?php
// No value.
else :
// Do something...
endif;
}
?>