added more info, edited arxiu and styled category convocatories

This commit is contained in:
Jorge vitrubio.net 2024-05-22 19:30:00 +02:00
parent c766b45be8
commit 1dd1cd99ea
13 changed files with 4419 additions and 239 deletions

3577
adminstyles.css Normal file

File diff suppressed because it is too large Load Diff

50
adminstyles.css.map Normal file

File diff suppressed because one or more lines are too long

View File

@ -31,8 +31,6 @@ get_header();
<?php endif; //end in_category agenda activitats ?>
</aside>
<?php if ( have_posts() ) : ?>
<content class="archive-posts <?php xarxaprod_class_posttype(); ?>">
@ -51,17 +49,17 @@ get_header();
} elseif (in_category( array( 'activitats') ) ) {
//get_template_part( 'template-parts/section', 'each-agenda-entry' );
$the_query_archive_activitats = new WP_Query(
$the_query_archive_activitats = new WP_Query(
array(
'post_type' => 'post',
'posts_per_page' => '-1', //show all => -1
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => 'activitats'
)
),
//'post_type' => 'post',
//'posts_per_page' => '-1', //show all => -1
//'tax_query' => array(
// array(
// 'taxonomy' => 'category',
// 'field' => 'slug',
// 'terms' => 'activitats'
// )
//),
'meta_query' => array(
array( //filter results show only older than today
'key' => 'xxp_agenda_date_end',
@ -87,6 +85,29 @@ get_header();
wp_reset_postdata(); //reset custom query
//end in_category agenda activitats
} elseif (in_category( array( 'convocatories') ) ) {
$the_query_archive_convocatories = new WP_Query(
array(
'post_type' => 'post',
'posts_per_page' => '-1', //show all => -1
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => 'convocatories'
)
),
)
);
if ( $the_query_archive_convocatories->have_posts() ) :
while ( $the_query_archive_convocatories->have_posts() ) : $the_query_archive_convocatories->the_post();
get_template_part( 'template-parts/section', 'eachconvo' );
endwhile;//end of the loop
endif; //end if the_query_archive_activitats
wp_reset_postdata(); //reset custom query
//end in_category convocatories
}else{
//the rest of archives
while ( have_posts() ) :

File diff suppressed because one or more lines are too long

View File

@ -35,57 +35,11 @@ get_header();
endif;
?>
<section id="filteredcalls" class="xarxaprod-filtered-content xarxaprod-filtered-content xarxaprod-filtered-calls xarxaprod-convos-filtrats">
<aside id="callsfilter" class="xarxaprod-filter-calls xarxaprod-fitre-convos">
<?php include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); if ( is_plugin_active( 'xarxaprod-wp-plugin/xarxaprod-wp-plugin.php' ) ) { // if plugin active do?>
<?php xarxaprod_convos_filters_form(); // function defined in the plugin ?>
<?php } //end if is_plugin_active ?>
</aside>
<?php
// comparing dates
// https://wordpress.stackexchange.com/a/12305
$the_query_archive_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
'posts_per_page' => '4',
'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 before today
'type' => 'DATE',
)
)
)
);
?>
<?php if ( $the_query_archive_convo->have_posts() ) : ?>
<content class="archive-posts archive-xarxaprod-convo <?php //xarxaprod_class_posttype(); ?>">
<?php while ( $the_query_archive_convo->have_posts() ) : $the_query_archive_convo->the_post(); ?>
<?php get_template_part( 'template-parts/section', 'eachconvo' ); ?>
<?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(); ?>
</content>
<?php endif; //end query convo ?>
</section>
<section id="filteredagenda" class="xarxaprod-filtered-content xarxaprod-filtered-agenda xarxaprod-activitats-filtrats category-agenda xarxaprod-activitats">
<header>
<h2 class="section-title"><a href="#">Activitats pasades</a></h2>
</header>
<aside id="agendafilter" class="xarxaprod-filter-agenda xarxaprod-fitre-agenda">
<?php include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); if ( is_plugin_active( 'xarxaprod-wp-plugin/xarxaprod-wp-plugin.php' ) ) { // if plugin active do?>
@ -143,6 +97,56 @@ get_header();
</section>
<section id="filteredcalls" class="xarxaprod-filtered-content xarxaprod-filtered-content xarxaprod-filtered-calls xarxaprod-convos-filtrats">
<header>
<h2 class="section-title"><a href="#">Convocatories</a></h2>
</header>
<aside id="callsfilter" class="xarxaprod-filter-calls xarxaprod-fitre-convos">
<?php include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); if ( is_plugin_active( 'xarxaprod-wp-plugin/xarxaprod-wp-plugin.php' ) ) { // if plugin active do?>
<?php xarxaprod_convos_filters_form(); // function defined in the plugin ?>
<?php } //end if is_plugin_active ?>
</aside>
<?php
// comparing dates
// https://wordpress.stackexchange.com/a/12305
$the_query_archive_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
'posts_per_page' => '4',
'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 before today
'type' => 'DATE',
)
)
)
);
?>
<?php if ( $the_query_archive_convo->have_posts() ) : ?>
<content class="archive-posts archive-xarxaprod-convo <?php //xarxaprod_class_posttype(); ?>">
<?php while ( $the_query_archive_convo->have_posts() ) : $the_query_archive_convo->the_post(); ?>
<?php get_template_part( 'template-parts/section', 'eachconvo' ); ?>
<?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(); ?>
</content>
<?php endif; //end query convo ?>
</section>
</main><!-- #main -->

View File

@ -392,7 +392,19 @@
* REC
*
* * * * * * * * * * * * * * * */
.xarxaprod-cards,.category-convocatories, .category-rec {
.archive.category-convocatories {
main {
> aside {
grid-column: -1 / 1;
}
> .archive-posts.category-convocatories {
grid-column: -1 / 1;
grid-template-columns: repeat(3, 1fr);
}
}
}
//.xarxaprod-cards,.category-convocatories, .category-rec {
.xarxaprod-cards,.category-rec {
display: flex;
flex-flow: column;
justify-content: flex-end;

View File

@ -91,6 +91,9 @@
display: grid;
grid-template-columns: 1fr;
gap: $grid__gap;
> header {
grid-column: -1 / 1;
}
.archive-posts {
}
}

View File

@ -5,7 +5,7 @@ Theme URI: https://git.hangar.org/xarxaprod/
Author: Hangar Tech Lab
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>
Version: 1.7.6
Version: 1.7.7
Tested up to: 6.5.2
Requires PHP: 7.4
License: GNU General Public License v3 or later

831
style.css

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -29,6 +29,13 @@
);
?>
</div><!-- .entry-content -->
<?php if( get_field('xxp_moreinfo_url') ): ?>
<div class="xarxaprod-moreinfo-url">
<a href="<?php echo get_field('xxp_moreinfo_url'); ?>" class="button button-more button-letsgo">
<?php echo __( '+ Info', 'xarxaprod' ); ?>
</a>
</div>
<?php endif; ?>
<?php if ( get_edit_post_link() ) : ?>
<footer class="entry-footer">

View File

@ -74,6 +74,15 @@
)
);
?>
<?php if( get_field('xxp_moreinfo_url') ): ?>
<div class="xarxaprod-moreinfo-url">
<a href="<?php echo get_field('xxp_moreinfo_url'); ?>" class="button button-more button-letsgo">
<?php echo __( '+ Info', 'xarxaprod' ); ?>
</a>
</div>
<?php endif; ?>
</main><!-- .entry-content -->
<footer class="entry-footer">

View File

@ -20,10 +20,11 @@
</h3>
<?php if( get_field('xxp_convo_apply_begin') || get_field('xxp_convo_apply_end') || get_field('xxp_convo_espai_associat') || get_field('xxp_convoer_name')): ?>
<section class="xarxaprod-convo-info-fields">
<ul>
<li class="xarxaprod-convo-info-date">
<?php if( get_field('xxp_convo_apply_begin') || get_field('xxp_convo_apply_end') ): ?>
<?php if( get_field('xxp_convo_apply_begin') || get_field('xxp_convo_apply_end') ): ?>
<dt>Termini</dt>
<dd class="xarxaprod-label item-xxp_convo_dates">
<?php if( get_field('xxp_convo_apply_begin') ): ?>
@ -37,9 +38,9 @@
<span class="item-xxp_convo_apply_text"><?php the_field('xxp_convo_apply_text'); ?></span>
<?php endif; ?>
</dd>
<?php endif; ?>
<?php endif;//end xxp_convo_apply_begin or xxp_convo_apply_end ?>
</li>
<?php if( ! get_field('xxp_convo_espai_associat') ): ?>
<?php if( ! get_field('xxp_convo_espai_associat') ): ?>
<?php // read here howto ?>
<?php // https://www.advancedcustomfields.com/resources/relationship/#display-list-of-posts-with-setuppostdata ?>
<?php if( get_field('xxp_convoer_name') ): ?>
@ -58,9 +59,10 @@
</li>
<?php endforeach; ?>
<?php // Reset the global post object so that the rest of the page works correctly.?>
<?php endif; //end get_field('xxp_convo_espai_associat') ?>
</ul>
</section>
<?php endif; //end get_field('xxp_convo_espai_associat') ?>
</ul>
</section>
<?php endif;//end xxp_convo_apply_begin or xxp_convo_apply_end ?>