85 lines
3.0 KiB
PHP
85 lines
3.0 KiB
PHP
<?php
|
|
/**
|
|
* Template part for displaying featured posts or "ajuts" and widgets
|
|
*
|
|
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
|
|
*
|
|
* @package Xarxaprod_theme
|
|
*/
|
|
|
|
?>
|
|
|
|
<aside id="convos" class="last-convos ultimes-convocatories">
|
|
<?php
|
|
// Detect plugin. For use on Front End only.
|
|
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
|
// check for plugin using plugin name
|
|
if ( is_plugin_active( 'xarxaprod-wp-plugin/xarxaprod-wp-plugin.php' ) ) {
|
|
//plugin is activated do
|
|
?>
|
|
<header>
|
|
<h2> <?php echo esc_html__('Últimes convocatòries', 'xarxaprod'); ?></h2>
|
|
</header>
|
|
<main class="xarxaprod-last-convos xarxaprod-ultimes-convocatories">
|
|
|
|
<?php
|
|
// https://developer.wordpress.org/reference/functions/get_posts/
|
|
// https://www.advancedcustomfields.com/resources/true-false/
|
|
$featured_query = new WP_Query(
|
|
array(
|
|
'post_type' => array( 'xarxaprod-convo' ),
|
|
'posts_per_page' => '3'
|
|
) );
|
|
?>
|
|
<?php if ( $featured_query->have_posts() ) : ?>
|
|
<?php while ( $featured_query->have_posts() ) : $featured_query->the_post(); ?>
|
|
|
|
<?php //get_template_part( 'template-parts/section', 'eachpost' ); ?>
|
|
|
|
<div class="xarxaprod-card-each xarxaprod-convo-info-field">
|
|
<header class="entry-header">
|
|
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" rel="bookmark" class="">
|
|
<?php the_title( '<h3 class="entry-title">', '</h3>' ); ?>
|
|
</a>
|
|
</header><!-- .entry-header -->
|
|
|
|
<?php if( get_field('os_convo_apply_begin') || get_field('os_convo_apply_end') ): ?>
|
|
|
|
<h6>Deadline:
|
|
<?php //the_field('os_convo_apply_begin'); ?>
|
|
<?php the_field('os_convo_apply_end'); ?>
|
|
</h6>
|
|
<?php endif; ?>
|
|
|
|
<?php if( get_field('os_convo_apply_text') ): ?>
|
|
<p class="item-os_convo_apply_text"><?php the_field('os_convo_apply_text'); ?></p>
|
|
<?php endif; ?>
|
|
|
|
<section class="excerpt post-excerpt">
|
|
<?php the_excerpt() ?>
|
|
</section>
|
|
<aside class="convo-sector convo-field">
|
|
<?php get_template_part( 'template-parts/section', 'list-checkbox', array('iterate_field' => 'os_convo_field') ); ?>
|
|
</aside>
|
|
|
|
<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>
|
|
|
|
</div>
|
|
|
|
<?php endwhile;//end of the loop ?>
|
|
<?php wp_reset_postdata(); ?>
|
|
<?php else : //if no post in query ?>
|
|
<p class="no-content"></p>
|
|
<?php endif; //end query ?>
|
|
|
|
|
|
|
|
</main>
|
|
<?php } //closing if is_plugin_active ?>
|
|
</aside>
|