espais associats maps and buttons in search

This commit is contained in:
jorge 2024-04-08 21:48:02 +02:00
parent a029f9f615
commit de29d69817
2 changed files with 9 additions and 37 deletions

View File

@ -20,7 +20,7 @@ get_header();
?> ?>
<header class="page-header"> <header class="page-header">
<h1><?php single_term_title( ' ' ); ?></h1> <h1><?php _e( 'Espais associats', 'xarxaprod' ); //single_term_title(''); ?></h1>
</header> </header>
<aside id="associatsfilter" class="xarxaprod-filter-associats xarxaprod-filtre-associats"> <aside id="associatsfilter" class="xarxaprod-filter-associats xarxaprod-filtre-associats">
@ -31,46 +31,18 @@ get_header();
<figure id="xarxaprod-associats-map" class="xarxaprod-associats-map"> <figure id="xarxaprod-associats-map" class="xarxaprod-associats-map">
<?php xarxaprod_show_leaflet_map(); // function defined in the plugin ?> <?php xarxaprod_show_leaflet_map(); // function defined in the plugin ?>
</figure> </figure>
<?php if ( have_posts() ) :?>
<?php <?php
//if ( have_posts() ) : //if ( have_posts() ) :
// while ( have_posts() ) : the_post(); while ( have_posts() ) : the_post();
// xarxaprod_show_leaflet_associat_blob(); // function defined in the plugin xarxaprod_show_leaflet_associat_blob(); // function defined in the plugin
// endwhile; endwhile;
//else :
// get_template_part( 'template-parts/content', 'none' );
//endif; //endif;
?> ?>
<?php
// https://support.advancedcustomfields.com/forums/topic/wp_query-using-meta_query-for-an-acf-checkbox-field/#post-145830
// https://www.advancedcustomfields.com/resources/checkbox/#query-posts
// https://barn2.com/blog/querying-posts-by-custom-field-acfi/
$the_query_associat = new WP_Query(
array(
'post_type' => 'xarxaprod-associat',
'order' => 'ASC', //order a b c d ...
'order_by' => 'name', // by name slug
'posts_per_page' => '-1' //all of them
)
);
?>
<?php if ( $the_query_associat->have_posts() ) : ?>
<?php while ( $the_query_associat->have_posts() ) : $the_query_associat->the_post(); ?>
<?php xarxaprod_show_leaflet_associat_blob(); ?>
<?php endwhile;//end of the loop ?>
<?php wp_reset_postdata(); ?>
<?php endif; //end query associat ?>
<?php <?php
// nuvol de nomb sde fabriques // nuvol de nom de fabriques
echo '<ul class="xarxaprod-label">'; echo '<ul class="xarxaprod-label">';
while ( have_posts() ) : the_post(); while ( have_posts() ) : the_post();
echo '<li>'; echo '<li>';
@ -85,7 +57,7 @@ get_header();
endwhile; endwhile;
echo '</ul>'; echo '</ul>';
?> ?>
<?php endif; //have_posts ?>
</content> </content>
<section id="filteredassociats" class="xarxaprod-filtered-content xarxaprod-filtered-associats xarxaprod-associats-filtrats"> <section id="filteredassociats" class="xarxaprod-filtered-content xarxaprod-filtered-associats xarxaprod-associats-filtrats">
</section> </section>

View File

@ -22,7 +22,7 @@
sprintf( sprintf(
wp_kses( wp_kses(
/* translators: %s: Name of current post. Only visible to screen readers */ /* translators: %s: Name of current post. Only visible to screen readers */
__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'xarxaprod' ), __( 'Continua llegin<span class="screen-reader-text"> "%s"</span>', 'xarxaprod' ),
array( array(
'span' => array( 'span' => array(
'class' => array(), 'class' => array(),
@ -143,7 +143,7 @@
<?php endif; ?> <?php endif; ?>
<?php if( get_field('xxp_associat_osm_link') ): ?> <?php if( get_field('xxp_associat_osm_link') ): ?>
<div class="xarxaprod-associat-osm-link"> <div class="xarxaprod-associat-osm-link">
<h6 class="">Localizatcio:</h6><p> <a href="<?php the_field('xxp_associat_osm_link'); ?>"><?php the_field('xxp_associat_osm_link'); ?></a></p> <h6 class="">Localizatcio:</h6><p> <a href="<?php the_field('xxp_associat_osm_link'); ?>" target="_blank" title="Obre openstreetmaps.org"><?php the_field('xxp_associat_osm_link'); ?></a></p>
</div> </div>
<?php endif; ?> <?php endif; ?>
</section> </section>