-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsidebar.php
executable file
·43 lines (39 loc) · 1.07 KB
/
sidebar.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/**
* The sidebar containing the main widget area
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package Garola_Real_Estate
*/
if (!is_active_sidebar('primary-sidebar') && is_singular('property')) { ?>
<aside id="secondary" class="widget-area col-md-4">
<?php
global $post;
$related_agent = get_field('related_agent');
if ($related_agent) {
foreach ($related_agent as $agent) {
$post = $agent;
setup_postdata($post);
?>
<div class="agent-widget">
<?php get_template_part('template-parts/content', 'agent'); ?>
</div>
<?php
}
wp_reset_postdata();
}
get_template_part('template-parts/content', 'property-search');
?>
</aside><!-- #secondary -->
<?php return;
}
if (!is_active_sidebar('primary-sidebar')) { ?>
<aside id="secondary" class="widget-area col-md-4">
<?php get_template_part('template-parts/content', 'property-search'); ?>
</aside>
<?php }
?>
<aside id="secondary" class="widget-area col-md-4">
<?php dynamic_sidebar('primary-sidebar'); ?>
</aside><!-- #secondary -->