2024-03-13 19:41:07 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* The template for displaying the "convos" calls with search capabilities
|
|
|
|
*
|
2024-05-23 12:47:29 +02:00
|
|
|
* Template Name: Arxiu Activitats
|
2024-03-13 19:41:07 +01:00
|
|
|
*
|
|
|
|
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
|
|
|
|
* @link https://developer.wordpress.org/themes/template-files-section/page-template-files/
|
|
|
|
*
|
|
|
|
* @package Xarxaprod_theme
|
|
|
|
* @since 1.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
get_header();
|
|
|
|
?>
|
|
|
|
<!-- page-templates convos-search-php -->
|
|
|
|
<main id="primary" class="site-main">
|
|
|
|
|
|
|
|
<?php if ( have_posts() ) : ?>
|
|
|
|
|
|
|
|
<header class="page-header">
|
|
|
|
</header><!-- .page-header -->
|
|
|
|
<?php
|
|
|
|
while ( have_posts() ) :
|
|
|
|
the_post();
|
|
|
|
|
|
|
|
get_template_part( 'template-parts/content', 'page' );
|
|
|
|
|
|
|
|
endwhile;
|
|
|
|
|
|
|
|
the_posts_navigation();
|
|
|
|
|
|
|
|
else :
|
|
|
|
get_template_part( 'template-parts/content', 'none' );
|
|
|
|
|
|
|
|
endif;
|
|
|
|
?>
|
2024-05-23 12:47:29 +02:00
|
|
|
|
|
|
|
<section id="arxiuactivitats" class="xarxaprod-filtered-content xarxaprod-filtered-arxiu xarxaprod-arxiu-agenda xarxaprod-arxiu-activitats">
|
|
|
|
<header>
|
|
|
|
</header>
|
|
|
|
|
|
|
|
<aside id="agendafilter" class="xarxaprod-filter-agenda xarxaprod-fitre-agenda">
|
2024-03-13 19:41:07 +01:00
|
|
|
</aside>
|
2024-05-23 12:47:29 +02:00
|
|
|
|
2024-03-13 19:41:07 +01:00
|
|
|
<?php
|
2024-05-23 12:47:29 +02:00
|
|
|
$the_query_archive_agenda = new WP_Query(
|
2024-03-13 19:41:07 +01:00
|
|
|
array(
|
2024-05-23 12:47:29 +02:00
|
|
|
'post_type' => 'post',
|
|
|
|
'posts_per_page' => '-1', //show all => -1
|
|
|
|
'tax_query' => array(
|
|
|
|
array(
|
|
|
|
'taxonomy' => 'category',
|
|
|
|
'field' => 'slug',
|
|
|
|
'terms' => 'activitats'
|
|
|
|
)
|
|
|
|
),
|
2024-03-13 19:41:07 +01:00
|
|
|
'order_by' => 'meta_value', //order by meta value
|
|
|
|
'order' => 'ASC', //order ascendent
|
|
|
|
'meta_query' => array(
|
|
|
|
array( //filter results show only older than today
|
2024-05-23 12:47:29 +02:00
|
|
|
'key' => 'xxp_agenda_date_end',
|
2024-03-13 19:41:07 +01:00
|
|
|
'value' => date("Y-m-d"), // consider using date_i18n() https://developer.wordpress.org/reference/functions/date_i18n/
|
|
|
|
'compare' => '<', //show events before today
|
|
|
|
'type' => 'DATE',
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
?>
|
2024-05-23 12:47:29 +02:00
|
|
|
<?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(); ?>
|
2024-03-13 19:41:07 +01:00
|
|
|
|
2024-05-23 12:47:29 +02:00
|
|
|
<?php get_template_part( 'template-parts/section', 'each-agenda-entry' ); ?>
|
2024-03-13 19:41:07 +01:00
|
|
|
|
|
|
|
<?php endwhile;//end of the loop ?>
|
2024-05-23 12:47:29 +02:00
|
|
|
<?php
|
|
|
|
// pagination will not work for custom_query
|
|
|
|
// https://wordpress.stackexchange.com/a/120408
|
|
|
|
// how to fix it
|
|
|
|
the_posts_navigation();
|
|
|
|
?>
|
2024-03-13 19:41:07 +01:00
|
|
|
<?php wp_reset_postdata(); ?>
|
2024-05-23 12:47:29 +02:00
|
|
|
</content>
|
|
|
|
<?php endif; //end query agenda ?>
|
|
|
|
|
|
|
|
</section>
|
2024-03-13 19:41:07 +01:00
|
|
|
|
|
|
|
</main><!-- #main -->
|
|
|
|
|
|
|
|
<?php
|
|
|
|
get_footer();
|