changed template loop calls, styled memembers

This commit is contained in:
jorge 2024-04-08 16:13:33 +02:00
parent d21f02c536
commit 9d2f99448e
14 changed files with 141 additions and 72 deletions

View File

@ -17,7 +17,7 @@ Theme URI: https://git.hangar.org/xarxaprod/
Author: Hangar.org Tech Lab - hangar.org Author: Hangar.org Tech Lab - hangar.org
Author URI: https://hangar.org Author URI: https://hangar.org
Description: theme for the <a href="https://xarxaprod.cat">XarxaProd</a>. Inclou la possibilitat de publicar, catalogar i cercar ajuts, resoldre dubtes amb FAQs i altres. Design by Eudald Van der Pla <a href="https://vanderpla.com">vanderpla.com</a>. Coding template and theme by <a href="https://vitrubio.net">Jorge - vitrubio.net</a> Description: theme for the <a href="https://xarxaprod.cat">XarxaProd</a>. Inclou la possibilitat de publicar, catalogar i cercar ajuts, resoldre dubtes amb FAQs i altres. Design by Eudald Van der Pla <a href="https://vanderpla.com">vanderpla.com</a>. Coding template and theme by <a href="https://vitrubio.net">Jorge - vitrubio.net</a>
Version: 1.6.1 Version: 1.6.5
Tested up to: 6.4 Tested up to: 6.4
Requires PHP: 7.4 Requires PHP: 7.4
License: GNU General Public License v3 or later License: GNU General Public License v3 or later
@ -1742,7 +1742,7 @@ Add your custom styles in this file so it is easier to update the theme.
min-height: 40vh; min-height: 40vh;
} }
.edit-post-visual-editor__content-area .editor-styles-wrapper .post-type-archive-xarxaprod-associat .archive-posts { .edit-post-visual-editor__content-area .editor-styles-wrapper .archive-posts.archive-posts {
grid-template-columns: 1fr; grid-template-columns: 1fr;
} }

File diff suppressed because one or more lines are too long

View File

@ -32,32 +32,61 @@ get_header();
<?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 while ( have_posts() ) : the_post(); //if ( have_posts() ) :
xarxaprod_show_leaflet_associat_blob(); // function defined in the plugin // while ( have_posts() ) : the_post();
//get_template_part( 'template-parts/section', 'eachmember' ); // xarxaprod_show_leaflet_associat_blob(); // function defined in the plugin
endwhile; ?> // endwhile;
//else :
// get_template_part( 'template-parts/content', 'none' );
//endif;
?>
<content class="archive-posts archive-posts-map archive-xarxaprod-members archive-xarxaprod-associats <?php xarxaprod_class_posttype(); ?>">
<?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 ?>
<ul class="xarxaprod-label">
<?php while ( have_posts() ) : the_post(); ?>
<li>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" rel="bookmark">
<?php the_title(); ?>
</a>
</li>
<?php endwhile; ?>
</ul>
<?php <?php
//the_posts_navigation(); // nuvol de nomb sde fabriques
echo '<ul class="xarxaprod-label">';
else : while ( have_posts() ) : the_post();
echo '<li>';
get_template_part( 'template-parts/content', 'none' ); echo '<a href="';
the_permalink();
endif; echo '" title="';
?> the_title();
echo '" rel="bookmark">';
the_title();
echo '</a>';
echo '</li>';
endwhile;
echo '</ul>';
?>
</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

@ -31,22 +31,49 @@ get_header();
<content class="archive-posts <?php xarxaprod_class_posttype(); ?>"> <content class="archive-posts <?php xarxaprod_class_posttype(); ?>">
<?php if ( have_posts() ) : ?> <?php
<?php while ( have_posts() ) : the_post(); // loop by default in archive.php
//if ( have_posts() ) :
get_template_part( 'template-parts/section', 'eachconvo' ); // while ( have_posts() ) : the_post();
// get_template_part( 'template-parts/section', 'eachconvo' );
endwhile; // endwhile;
// the_posts_navigation();
the_posts_navigation(); //else :
// get_template_part( 'template-parts/content', 'none' );
else : //endif;
get_template_part( 'template-parts/content', 'none' );
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_convo = new WP_Query(
array(
'post_type' => 'xarxaprod-convo',
'order_by' => 'meta_value', //order by meta value
'meta_key' => 'xxp_convo_apply_end', // order by meta key convo apply end
'order' => 'ASC', //order ascendent
'posts_per_page' => '-1', //show all
'meta_query' => array(
array( //filter results show only older than today
'key' => 'xxp_convo_apply_end',
'value' => date("Y-m-d"), // consider using date_i18n() https://developer.wordpress.org/reference/functions/date_i18n/
'compare' => '>=', //show events from today and later
'type' => 'DATE',
)
)
)
);
?>
<?php if ( $the_query_convo->have_posts() ) : ?>
<?php while ( $the_query_convo->have_posts() ) : $the_query_convo->the_post(); ?>
<?php get_template_part( 'template-parts/section', 'eachconvo' , $the_query_convo); ?>
<?php endwhile;//end of the loop ?>
<?php wp_reset_postdata(); ?>
<?php endif; ?>
</content> </content>
<section id="filteredcall" class="xarxaprod-filtered-content xarxaprod-filtered-convos xarxaprod-convos-filtrats"> <section id="filteredcall" class="xarxaprod-filtered-content xarxaprod-filtered-convos xarxaprod-convos-filtrats">
</section> </section>

File diff suppressed because one or more lines are too long

View File

@ -46,6 +46,7 @@ get_header();
); ?> ); ?>
</aside> </aside>
<content class="archive-posts <?php //xarxaprod_class_posttype(); ?>">
<?php <?php
$the_query_archive_agenda = new WP_Query( $the_query_archive_agenda = new WP_Query(
array( array(
@ -73,7 +74,6 @@ get_header();
); );
?> ?>
<?php if ( $the_query_archive_agenda->have_posts() ) : ?> <?php if ( $the_query_archive_agenda->have_posts() ) : ?>
<content class="archive-posts <?php //xarxaprod_class_posttype(); ?>">
<?php while ( $the_query_archive_agenda->have_posts() ) : $the_query_archive_agenda->the_post(); ?> <?php while ( $the_query_archive_agenda->have_posts() ) : $the_query_archive_agenda->the_post(); ?>
<?php get_template_part( 'template-parts/section', 'each-agenda-entry' ); ?> <?php get_template_part( 'template-parts/section', 'each-agenda-entry' ); ?>
@ -86,8 +86,8 @@ get_header();
the_posts_navigation(); the_posts_navigation();
?> ?>
<?php wp_reset_postdata(); ?> <?php wp_reset_postdata(); ?>
</content>
<?php endif; //end query convo ?> <?php endif; //end query convo ?>
</content>
</section> </section>
</main><!-- #main --> </main><!-- #main -->

View File

@ -45,6 +45,7 @@ get_header();
</aside> </aside>
<content class="archive-posts archive-xarxaprod-fund archive-xarxapdor-ajut <?php //xarxaprod_class_posttype(); ?>">
<?php <?php
// https://support.advancedcustomfields.com/forums/topic/wp_query-using-meta_query-for-an-acf-checkbox-field/#post-145830 // 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://www.advancedcustomfields.com/resources/checkbox/#query-posts
@ -58,15 +59,14 @@ get_header();
); );
?> ?>
<?php if ( $the_query_ajut->have_posts() ) : ?> <?php if ( $the_query_ajut->have_posts() ) : ?>
<content class="archive-posts archive-xarxaprod-fund archive-xarxapdor-ajut <?php //xarxaprod_class_posttype(); ?>">
<?php while ( $the_query_ajut->have_posts() ) : $the_query_ajut->the_post(); ?> <?php while ( $the_query_ajut->have_posts() ) : $the_query_ajut->the_post(); ?>
<?php get_template_part( 'template-parts/section', 'eachfund' ); ?> <?php get_template_part( 'template-parts/section', 'eachfund' ); ?>
<?php endwhile;//end of the loop ?> <?php endwhile;//end of the loop ?>
<?php wp_reset_postdata(); ?> <?php wp_reset_postdata(); ?>
</content>
<?php endif; //end query ajut ?> <?php endif; //end query ajut ?>
</content>
</section> </section>

View File

@ -72,6 +72,12 @@ get_header();
<?php get_template_part( 'template-parts/section', 'eachconvo' ); ?> <?php get_template_part( 'template-parts/section', 'eachconvo' ); ?>
<?php endwhile;//end of the loop ?> <?php endwhile;//end of the loop ?>
<?php
// pagination will not work for custom_query
// https://wordpress.stackexchange.com/a/120408
// how to fix it
the_posts_navigation();
?>
<?php wp_reset_postdata(); ?> <?php wp_reset_postdata(); ?>
</content> </content>
<?php endif; //end query convo ?> <?php endif; //end query convo ?>

View File

@ -45,6 +45,7 @@ get_header();
</aside> </aside>
<content class="archive-posts archive-posts-map archive-xarxaprod-members archive-xarxaprod-associats <?php xarxaprod_class_posttype(); ?>">
<?php <?php
// https://support.advancedcustomfields.com/forums/topic/wp_query-using-meta_query-for-an-acf-checkbox-field/#post-145830 // 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://www.advancedcustomfields.com/resources/checkbox/#query-posts
@ -61,30 +62,38 @@ get_header();
?> ?>
<?php if ( $the_query_associat->have_posts() ) : ?> <?php if ( $the_query_associat->have_posts() ) : ?>
<content class="archive-posts archive-posts-map archive-xarxaprod-members archive-xarxaprod-associats <?php xarxaprod_class_posttype(); ?>"> <figure id="espais-associats-map" class="xarxaprod-associats-map xarxaprod-espais-map">
<figure id="espais-associats-map" class="xarxaprod-associats-map xarxaprod-espais-map">
<?php xarxaprod_show_leaflet_map(); // function defined in the plugin ?> <?php xarxaprod_show_leaflet_map(); // function defined in the plugin ?>
<?php while ( $the_query_associat->have_posts() ) : $the_query_associat->the_post(); ?> <?php while ( $the_query_associat->have_posts() ) : $the_query_associat->the_post(); ?>
<?php xarxaprod_show_leaflet_associat_blob(); ?> <?php xarxaprod_show_leaflet_associat_blob(); ?>
<?php endwhile;//end of the loop ?> <?php endwhile;//end of the loop ?>
</figure> </figure>
<?php wp_reset_postdata(); ?>
</content> <?php
<?php // nuvol de nomb sde fabriques
//the loop for text output echo '<ul class="xarxaprod-label">';
//echo '<content class="archive-posts archive-xarxaprod-members archive-xarxaprod-associats' . xarxaprod_class_posttype() . '">'; while ( $the_query_associat->have_posts() ) : $the_query_associat->the_post();
//while ( $the_query_associat->have_posts() ) : $the_query_associat->the_post(); echo '<li>';
//get_template_part( 'template-parts/section', 'eachmember' ); echo '<a href="';
//endwhile;//end of the loop the_permalink();
//echo '</content>'; echo '" title="';
?> the_title();
<?php endif; //end query associat ?> echo '" rel="bookmark">';
the_title();
echo '</a>';
echo '</li>';
endwhile;
echo '</ul>';
?>
<?php wp_reset_postdata(); ?>
<?php endif; //end query associat ?>
</content>
</section> </section>
</main><!-- #main --> </main><!-- #main -->

View File

@ -43,6 +43,7 @@ get_header();
<?php } //end if is_plugin_active ?> <?php } //end if is_plugin_active ?>
</aside> </aside>
<content class="archive-posts archive-xarxaprod-convo <?php //xarxaprod_class_posttype(); ?>">
<?php <?php
// https://support.advancedcustomfields.com/forums/topic/wp_query-using-meta_query-for-an-acf-checkbox-field/#post-145830 // 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://www.advancedcustomfields.com/resources/checkbox/#query-posts
@ -66,15 +67,14 @@ get_header();
); );
?> ?>
<?php if ( $the_query_convo->have_posts() ) : ?> <?php if ( $the_query_convo->have_posts() ) : ?>
<content class="archive-posts archive-xarxaprod-convo <?php //xarxaprod_class_posttype(); ?>">
<?php while ( $the_query_convo->have_posts() ) : $the_query_convo->the_post(); ?> <?php while ( $the_query_convo->have_posts() ) : $the_query_convo->the_post(); ?>
<?php get_template_part( 'template-parts/section', 'eachconvo' , $the_query_convo); ?> <?php get_template_part( 'template-parts/section', 'eachconvo' , $the_query_convo); ?>
<?php endwhile;//end of the loop ?> <?php endwhile;//end of the loop ?>
<?php wp_reset_postdata(); ?> <?php wp_reset_postdata(); ?>
</content>
<?php endif; //end query convo ?> <?php endif; //end query convo ?>
</content>
</section> </section>
</main><!-- #main --> </main><!-- #main -->

View File

@ -265,9 +265,7 @@
.archive-posts { .archive-posts {
grid-template-columns: repeat(2 , 1fr); grid-template-columns: repeat(2 , 1fr);
min-height: 40vh; min-height: 40vh;
} &.archive-posts {
.post-type-archive-xarxaprod-associat {
.archive-posts {
grid-template-columns: 1fr; grid-template-columns: 1fr;
} }
} }

View File

@ -5,7 +5,7 @@ Theme URI: https://git.hangar.org/xarxaprod/
Author: Hangar.org Tech Lab - hangar.org Author: Hangar.org Tech Lab - hangar.org
Author URI: https://hangar.org Author URI: https://hangar.org
Description: theme for the <a href="https://xarxaprod.cat">XarxaProd</a>. Inclou la possibilitat de publicar, catalogar i cercar ajuts, resoldre dubtes amb FAQs i altres. Design by Eudald Van der Pla <a href="https://vanderpla.com">vanderpla.com</a>. Coding template and theme by <a href="https://vitrubio.net">Jorge - vitrubio.net</a> Description: theme for the <a href="https://xarxaprod.cat">XarxaProd</a>. Inclou la possibilitat de publicar, catalogar i cercar ajuts, resoldre dubtes amb FAQs i altres. Design by Eudald Van der Pla <a href="https://vanderpla.com">vanderpla.com</a>. Coding template and theme by <a href="https://vitrubio.net">Jorge - vitrubio.net</a>
Version: 1.6.1 Version: 1.6.5
Tested up to: 6.4 Tested up to: 6.4
Requires PHP: 7.4 Requires PHP: 7.4
License: GNU General Public License v3 or later License: GNU General Public License v3 or later

View File

@ -5,7 +5,7 @@ Theme URI: https://git.hangar.org/xarxaprod/
Author: Hangar.org Tech Lab - hangar.org Author: Hangar.org Tech Lab - hangar.org
Author URI: https://hangar.org Author URI: https://hangar.org
Description: theme for the <a href="https://xarxaprod.cat">XarxaProd</a>. Inclou la possibilitat de publicar, catalogar i cercar ajuts, resoldre dubtes amb FAQs i altres. Design by Eudald Van der Pla <a href="https://vanderpla.com">vanderpla.com</a>. Coding template and theme by <a href="https://vitrubio.net">Jorge - vitrubio.net</a> Description: theme for the <a href="https://xarxaprod.cat">XarxaProd</a>. Inclou la possibilitat de publicar, catalogar i cercar ajuts, resoldre dubtes amb FAQs i altres. Design by Eudald Van der Pla <a href="https://vanderpla.com">vanderpla.com</a>. Coding template and theme by <a href="https://vitrubio.net">Jorge - vitrubio.net</a>
Version: 1.6.1 Version: 1.6.5
Tested up to: 6.4 Tested up to: 6.4
Requires PHP: 7.4 Requires PHP: 7.4
License: GNU General Public License v3 or later License: GNU General Public License v3 or later
@ -1606,7 +1606,7 @@ textarea {
min-height: 40vh; min-height: 40vh;
} }
.post-type-archive-xarxaprod-associat .archive-posts { .archive-posts.archive-posts {
grid-template-columns: 1fr; grid-template-columns: 1fr;
} }

File diff suppressed because one or more lines are too long