File: /home/slyfwmm/incastiglionfiorentino/wp-content/themes/amplify/sidebar.php
<?php
/**
* The Sidebar containing the primary and secondary widget areas.
*
*/
?>
<div class="box_third mt35 last">
<ul class="widgets">
<li>
<?php
//MODULO DI RICERCA DELLE STRUTTURE, SEMPRE FISSO IN CIMA ALLA SIDEBAR
?>
<h5 class="regcase">Ricarca struttura</h5>
<form name="search" id="search" action="https://incastiglionfiorentino.com/cerca-strutture" method="post">
<label>Tipo</label>
<select id="tipi-seleziona" name="tipi-seleziona[]" multiple="multiple" style="width:100%;">
<?php
$inserzione = 'inserzione';
$inserzioni = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT $wpdb->terms.name FROM $wpdb->term_taxonomy, $wpdb->terms WHERE taxonomy = %s AND $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id ORDER BY $wpdb->terms.name ASC", $inserzione) );
if ($inserzioni)
{
foreach ($inserzioni as $inserzione)
{
echo "<option value=\"";
_e($inserzione);
echo "\">";
_e($inserzione);
echo "</option>";
}
}
?>
</select>
<br />
<label>Locazione</label>
<select id="locazioni-seleziona" name="locazioni-seleziona[]" multiple="multiple" style="width:100%;">
<?php
$locazione = 'locazione';
$locazioni = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT $wpdb->terms.name FROM $wpdb->term_taxonomy, $wpdb->terms WHERE taxonomy = %s AND $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id ORDER BY $wpdb->terms.name ASC", $locazione) );
if ($locazioni)
{
foreach ($locazioni as $locazione)
{
echo "<option value=\"";
_e($locazione);
echo "\">";
_e($locazione);
echo "</option>";
}
}
?>
</select>
<br />
<label>Servizi</label>
<select id="servizi-seleziona" name="servizi-seleziona[]" multiple="multiple" style="width:100%;">
<?php
$servizio = 'servizi';
$servizi = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT $wpdb->terms.name FROM $wpdb->term_taxonomy, $wpdb->terms WHERE taxonomy = %s AND $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id ORDER BY $wpdb->terms.name ASC", $servizio) );
if ($servizi)
{
foreach ($servizi as $servizio)
{
echo "<option value=\"";
_e($servizio);
echo "\">";
_e($servizio);
echo "</option>";
}
}
?>
</select>
<br />
<input type="submit" value="CERCA" class="bottone-cerca" />
</form>
<?php
// fine modulo ricerca
?>
</li>
</ul>
<ul class="widgets">
<li>
<div class="adv-box-distanza">
<!--/* main box */-->
<!--/* ad spray advertise */-->
<!--/* main box fine*/-->
</div>
</li>
</ul>
<ul class="widgets">
<li>
<h5 class="regcase">Ultimi articoli</h5>
<ul class="thumblist mb12">
<!-- RECENT POSTS BEGIN -->
<?php
$temp = $wp_query;
$wp_query= null;
$wp_query = new WP_Query('cat=-1,-5,-6,-7,-9' . $wpc_blog_category . '&paged=' . $paged . '&showposts=3');
$count = 0;
while ($wp_query->have_posts()) : $wp_query->the_post();
?>
<li style="height:auto;margin-bottom:15px;"><a class="float_l" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<div style="display:inline-block;width:100px;height:100px;margin-right:15px;"><img src="<?php if(get_field('large_image_value') != NULL) {echo get_field('large_image_value');} else {echo get_field('fullsize_value');} ?>" alt="<?php the_title(); ?>" style="margin:0;box-sizing:border-box;width:100%;height:100%;object-fit:cover;" /></div>
</a><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a><span class="date"><?php the_time('j.n.y') ?></span><div class="clearboth"></div></li>
<?php endwhile;
$wp_query = null; $wp_query = $temp; ?>
<!-- RECENT POSTS END -->
</ul>
</li>
</ul>
<!--<ul class="widgets">
<li>
<div align="center" class="adv-box-2-distanza"><a href="http://incastiglionfiorentino.com/la-tua-pubblicita-in-questo-sito-web/"><img src="<?php echo get_template_directory_uri(); ?>/images/300_250.png" alt="ADV SPACE" /></a></div>
</li>
</ul>-->
<?php
// parte alta della sidebar, se non ci sono widget è vuota
if ( is_active_sidebar( 'primary-widget-area' ) ) : ?>
<ul class="widgets">
<?php if ( ! dynamic_sidebar( 'primary-widget-area' ) ) : ?>
<li>
</li>
<?php endif; // end primary widget area ?>
</ul>
<?php endif;
//METTERE QUI QUALSIASI COSA TRA LA PRIMA E LA SECONDA SIDEBAR CHE VOGLIAMO APPAIA, OPPURE METTERELò IN FONDO AI WIDGET DELLA PRIMA, O IN CIMA A QUELLI DELLA SECONDA SIDEBAR
// barte bassa della sidebar, se non ci sono widget è vuota
if ( is_active_sidebar( 'secondary-widget-area' ) ) : ?>
<ul class="widgets">
<?php if ( ! dynamic_sidebar( 'secondary-widget-area' ) ) : ?>
<li>
</li>
<?php endif; // end secondary widget area ?>
</ul>
<?php endif; ?>
</div>