2024-03-11 13:26:27 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Template part for displaying each convo with each field in category, archive, search
|
|
|
|
* to be used inside the loop.
|
|
|
|
*
|
|
|
|
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
|
|
|
|
*
|
|
|
|
* @package Xarxaprod_theme
|
2024-04-03 15:07:53 +02:00
|
|
|
* @used_by page-template/convo-serach.php
|
|
|
|
* @used_by page-template/convo-archive.php
|
|
|
|
*
|
2024-03-11 13:26:27 +01:00
|
|
|
*/
|
|
|
|
?>
|
|
|
|
|
2024-04-03 15:07:53 +02:00
|
|
|
<article id="post-<?php the_ID(); ?>" <?php post_class('xarxaprod-card-each'); ?> >
|
|
|
|
<h3 class="entry-title">
|
|
|
|
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" rel="bookmark">
|
|
|
|
<?php the_title(); ?>
|
|
|
|
</a>
|
|
|
|
</h3>
|
|
|
|
|
|
|
|
|
2024-05-22 19:30:00 +02:00
|
|
|
<?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')): ?>
|
2024-04-03 15:07:53 +02:00
|
|
|
<section class="xarxaprod-convo-info-fields">
|
|
|
|
<ul>
|
|
|
|
<li class="xarxaprod-convo-info-date">
|
2024-05-22 19:30:00 +02:00
|
|
|
<?php if( get_field('xxp_convo_apply_begin') || get_field('xxp_convo_apply_end') ): ?>
|
2024-04-03 15:07:53 +02:00
|
|
|
<dt>Termini</dt>
|
|
|
|
<dd class="xarxaprod-label item-xxp_convo_dates">
|
|
|
|
<?php if( get_field('xxp_convo_apply_begin') ): ?>
|
|
|
|
<span class="item-xxp_convo_apply_begin">del <?php the_field('xxp_convo_apply_begin'); ?> </span>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php if( get_field('xxp_convo_apply_end') && !get_field('xxp_convo_apply_begin') ){ echo 'fins'; } ?>
|
|
|
|
<?php if( get_field('xxp_convo_apply_end') ): ?>
|
|
|
|
<span class="item-xxp_convo_apply_end">al <?php the_field('xxp_convo_apply_end'); ?> </span>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php if( get_field('xxp_convo_apply_text') ): ?>
|
|
|
|
<span class="item-xxp_convo_apply_text"><?php the_field('xxp_convo_apply_text'); ?></span>
|
|
|
|
<?php endif; ?>
|
|
|
|
</dd>
|
2024-05-22 19:30:00 +02:00
|
|
|
<?php endif;//end xxp_convo_apply_begin or xxp_convo_apply_end ?>
|
2024-04-03 15:07:53 +02:00
|
|
|
</li>
|
2024-05-22 19:30:00 +02:00
|
|
|
<?php if( ! get_field('xxp_convo_espai_associat') ): ?>
|
2024-04-03 15:07:53 +02:00
|
|
|
<?php // read here howto ?>
|
|
|
|
<?php // https://www.advancedcustomfields.com/resources/relationship/#display-list-of-posts-with-setuppostdata ?>
|
|
|
|
<?php if( get_field('xxp_convoer_name') ): ?>
|
|
|
|
<li class="xarxaprod-convo-field">
|
|
|
|
<dt></dt>
|
|
|
|
<dd class="xarxaprod-convoer-name"><?php the_field('xxp_convoer_name'); ?></dd>
|
|
|
|
</li>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php else: //exists get_field('xxp_convo_espai_associat')?>
|
|
|
|
<?php $espai_associat_posts = get_field('xxp_convo_espai_associat'); ?>
|
|
|
|
<?php foreach( $espai_associat_posts as $thispost ): ?>
|
|
|
|
<?php // Setup this post for WP functions (variable must be named $post).?>
|
|
|
|
<li class="xarxaprod-convo-espai-associat">
|
|
|
|
<dt></dt>
|
|
|
|
<dd><a href="<?php echo ($thispost->guid);//the_permalink(); ?>"><?php echo ($thispost->post_title); ?><?php //the_title(); ?></a></dd>
|
|
|
|
</li>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
<?php // Reset the global post object so that the rest of the page works correctly.?>
|
2024-05-22 19:30:00 +02:00
|
|
|
<?php endif; //end get_field('xxp_convo_espai_associat') ?>
|
|
|
|
</ul>
|
|
|
|
</section>
|
|
|
|
<?php endif;//end xxp_convo_apply_begin or xxp_convo_apply_end ?>
|
2024-04-03 15:07:53 +02:00
|
|
|
|
2024-03-14 11:35:02 +01:00
|
|
|
|
|
|
|
|
2024-03-11 13:26:27 +01:00
|
|
|
<section class="excerpt post-excerpt">
|
2024-03-14 11:35:02 +01:00
|
|
|
<?php //the_excerpt() ?>
|
|
|
|
<?php echo wp_trim_words(get_the_excerpt(), 30); // https://developer.wordpress.org/reference/functions/wp_trim_words/?>
|
|
|
|
|
2024-03-11 13:26:27 +01:00
|
|
|
</section>
|
2024-03-14 11:35:02 +01:00
|
|
|
|
2024-03-11 13:26:27 +01:00
|
|
|
<aside>
|
2024-04-03 15:07:53 +02:00
|
|
|
<?php get_template_part(
|
|
|
|
'template-parts/section',
|
|
|
|
'list-checkbox',
|
|
|
|
array('iterate_field' => 'xxp_convo_field')
|
|
|
|
); ?>
|
|
|
|
|
|
|
|
<?php get_template_part(
|
|
|
|
'template-parts/section',
|
|
|
|
'list-checkbox',
|
|
|
|
array('iterate_field' => 'xxp_convo_territory')
|
|
|
|
); ?>
|
|
|
|
|
|
|
|
<?php get_template_part(
|
|
|
|
'template-parts/section',
|
|
|
|
'list-checkbox',
|
|
|
|
array('iterate_field' => 'xxp_convo_service')
|
|
|
|
); ?>
|
|
|
|
|
2024-03-11 13:26:27 +01:00
|
|
|
</aside>
|
2024-03-14 11:35:02 +01:00
|
|
|
|
2024-03-11 13:26:27 +01:00
|
|
|
<nav class="more-link">
|
|
|
|
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" rel="bookmark" class="button button-more">
|
|
|
|
Més info
|
|
|
|
<span class="hide"><?php the_title(); ?></span>
|
|
|
|
</a>
|
|
|
|
</nav>
|
2024-03-14 11:35:02 +01:00
|
|
|
|
2024-03-11 13:26:27 +01:00
|
|
|
</article><!-- #post-<?php the_ID(); ?> -->
|