added convo templates

This commit is contained in:
jorge 2024-01-26 10:21:27 +01:00
parent ad5f8daf6a
commit cc45de2901
2 changed files with 178 additions and 0 deletions

View File

@ -0,0 +1,53 @@
<?php
/**
* The template for displaying archive custom post type xarxaprod-convo
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package Xarxaprod_theme
*/
get_header();
?>
<main id="primary" class="site-main archive-xarxaprod-convo-php">
<?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
?>
<section id="filteredconvos" class="xarxaprod-filtered-convos xarxaprod-convos-filtrats">convo<aside id="convosfilter" class="xarxaprod-filter-convos xarxaprod-filtre-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>
<content class="archive-posts <?php xarxaprod_class_posttype(); ?>">
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post();
get_template_part( 'template-parts/section', 'eachpost' );
endwhile;
the_posts_navigation();
else :
get_template_part( 'template-parts/content', 'none' );
endif;
?>
</content>
</section>
<?php } //end plugin is activated do ?>
</main><!-- #main -->
<?php
get_footer();

View File

@ -0,0 +1,125 @@
<?php
/**
* Template part for displaying posts
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package Xarxaprod_theme
*/
?>
<!-- template-parts/content-xarxaprod-convo.php -->
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
</header><!-- .entry-header -->
<section class="xarxaprod-convo-info-contact-fields">
<div class="xarxaprod-convo-info-field">
<?php get_template_part( 'template-parts/section', 'list-checkbox', array('iterate_field' => 'os_convo_call') ); ?>
</div>
<?php if( get_field('os_convoer_name') ): ?>
<div class="xarxaprod-convo-info-field">
<p class="xarxaprod-convoer-name"><?php the_field('os_convoer_name'); ?></p>
</div>
<?php endif; ?>
<?php if( get_field('os_convo_contact_name') ): ?>
<div class="xarxaprod-convo-info-field">
<p class="xarxaprod-convo-contact-name"><?php the_field('os_convo_contact_name'); ?></p>
</div>
<?php endif; ?>
<?php if( get_field('os_convo_contact_mail') ): ?>
<div class="xarxaprod-convo-info-field">
<p class="xarxaprod-convo-contact-mail"><?php the_field('os_convo_contact_mail'); ?></p>
</div>
<?php endif; ?>
<?php if( get_field('os_convo_contact_tel') ): ?>
<div class="xarxaprod-convo-info-field">
<p class="xarxaprod-convo-contact-tel"><?php the_field('os_convo_contact_tel'); ?></p>
</div>
<?php endif; ?>
</section>
<div class="entry-content">
<?php
the_content(
sprintf(
wp_kses(
/* translators: %s: Name of current post. Only visible to screen readers */
__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'xarxaprod' ),
array(
'span' => array(
'class' => array(),
),
)
),
wp_kses_post( get_the_title() )
)
);
wp_link_pages(
array(
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'xarxaprod' ),
'after' => '</div>',
)
);
?>
</div><!-- .entry-content -->
<section class="xarxaprod-convo-info-fields">
<div class="xarxaprod-convo-info-field">
<h6>Dirigit a</h6>
<?php get_template_part( 'template-parts/section', 'list-checkbox', array('iterate_field' => 'os_convo_target') ); ?>
</div>
<div class="xarxaprod-convo-info-field">
<h6>Tipus d'ajuda</h6>
<?php get_template_part( 'template-parts/section', 'list-checkbox', array('iterate_field' => 'os_convo_source') ); ?>
</div>
<div class="xarxaprod-convo-info-field">
<h6>Sectors</h6>
<?php get_template_part( 'template-parts/section', 'list-checkbox', array('iterate_field' => 'os_convo_field') ); ?>
</div>
<div class="xarxaprod-convo-info-field">
<h6>Termini</h6>
<?php if( get_field('os_convo_apply_begin') || get_field('os_convo_apply_end') ): ?>
<ul class="xarxaprod-label item-os_convo_dates">
<li class="item-os_convo_apply_begin">del <?php the_field('os_convo_apply_begin'); ?> </li>
<li class="item-os_convo_apply_end">al <?php the_field('os_convo_apply_end'); ?> </li>
</ul>
<?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; ?>
</div>
<?php if( get_field('os_convo_web') ): ?>
<div class="xarxaprod-convo-info-field">
<h6>+ Informació</h6>
<p><a href="<?php the_field('os_convo_web'); ?>" class="button button-more button-letsgo">ves-hi</a></p>
</div>
<?php endif; ?>
<div class="xarxaprod-convo-info-field">
<h6>Necessites assesorament?</h6>
<p><a href="<?php echo esc_url( home_url( '/consultoria/' ) ); ?>" class="button button-more button-ourservices">Oferim serveis de consultoria</a></p>
</div>
</section>
<footer class="entry-footer">
<?php xarxaprod_entry_footer(); ?>
</footer><!-- .entry-footer -->
</article><!-- #post-<?php the_ID(); ?> -->