Compare commits

...

2 Commits

15 changed files with 428 additions and 61 deletions

View File

@ -17,7 +17,7 @@ Theme URI: https://git.hangar.org/xarxaprod/
Author: Hangar.org Tech Lab - hangar.org Author: Hangar.org Tech Lab - hangar.org
Author URI: https://hangar.org 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> 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.0 Version: 1.7.2
Tested up to: 6.5 Tested up to: 6.5
Requires PHP: 7.4 Requires PHP: 7.4
License: GNU General Public License v3 or later License: GNU General Public License v3 or later
@ -1416,6 +1416,59 @@ Add your custom styles in this file so it is easier to update the theme.
.edit-post-visual-editor__content-area .editor-styles-wrapper ul[id*="menu-social-media"] li a[href*="mastodon"]::before { .edit-post-visual-editor__content-area .editor-styles-wrapper ul[id*="menu-social-media"] li a[href*="mastodon"]::before {
content: "mt"; content: "mt";
} }
.edit-post-visual-editor__content-area .editor-styles-wrapper ul[class*="xarxaprod-associat-social-links"] {
display: flex;
flex-flow: row;
margin: 0;
}
.edit-post-visual-editor__content-area .editor-styles-wrapper ul[class*="xarxaprod-associat-social-links"] li {
height: 1.5em;
width: 1.5em;
background-color: inherit;
border-radius: 5em;
border: none !important;
margin-right: 0.3em;
position: relative;
}
.edit-post-visual-editor__content-area .editor-styles-wrapper ul[class*="xarxaprod-associat-social-links"] li a {
font-size: 0;
}
.edit-post-visual-editor__content-area .editor-styles-wrapper ul[class*="xarxaprod-associat-social-links"] li a::before {
content: "";
display: inline-flex;
align-content: center;
justify-content: center;
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
font-size: 1rem;
}
.edit-post-visual-editor__content-area .editor-styles-wrapper ul[class*="xarxaprod-associat-social-links"] li a[href*="instagram.com"]::before {
content: "in";
}
.edit-post-visual-editor__content-area .editor-styles-wrapper ul[class*="xarxaprod-associat-social-links"] li a[href*="youtube.com"]::before {
content: "yt";
}
.edit-post-visual-editor__content-area .editor-styles-wrapper ul[class*="xarxaprod-associat-social-links"] li a[href*="facebook.com"]::before {
content: "fb";
}
.edit-post-visual-editor__content-area .editor-styles-wrapper ul[class*="xarxaprod-associat-social-links"] li a[href*="twitter.com"]::before {
content: "tw";
}
.edit-post-visual-editor__content-area .editor-styles-wrapper ul[class*="xarxaprod-associat-social-links"] li a[href*="mastodon"]::before {
content: "mt";
}
} }
.edit-post-visual-editor__content-area .editor-styles-wrapper embed, .edit-post-visual-editor__content-area .editor-styles-wrapper embed,

File diff suppressed because one or more lines are too long

View File

@ -31,23 +31,79 @@ get_header();
</aside> </aside>
<content class="archive-posts <?php xarxaprod_class_posttype(); ?>"> <content class="archive-posts <?php xarxaprod_class_posttype(); ?>">
<?php
<?php if ( have_posts() ) : ?> // very wired, need to output
<?php while ( have_posts() ) : the_post(); // 1. today's events 'compare' => '='
// 2. then after today 'compare' => '>'
get_template_part( 'template-parts/section', 'eachfund' ); //
// if done with '>=' outputs
endwhile; // 1. older dates in asc order
// 2. at the end today
the_posts_navigation();
else :
get_template_part( 'template-parts/content', 'none' );
endif;
?> ?>
<?php
// https://support.advancedcustomfields.com/forums/topic/wp_query-using-meta_query-for-an-acf-checkbox-field/#post-145830
// https://www.advancedcustomfields.com/resources/checkbox/#query-posts
// https://barn2.com/blog/querying-posts-by-custom-field-acfi/
$the_query_ajut = new WP_Query(
array(
'post_type' => 'xarxaprod-ajut',
'posts_per_page' => '-1',
'meta_key' => 'xxp_fund_apply_end', // order by meta key convo apply end
'meta_query' => array(
array( //filter results show only older than today
'key' => 'xxp_fund_apply_end',
'value' => date("Y-m-d"), // consider using date_i18n() https://developer.wordpress.org/reference/functions/date_i18n/
'compare' => '=', //show events from today and later
'type' => 'DATE',
)
),
//https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters
'orderby' => 'meta_value', //order by meta value
'order' => 'ASC', //order ascendent
)
);
?>
<?php if ( $the_query_ajut->have_posts() ) : ?>
<?php while ( $the_query_ajut->have_posts() ) : $the_query_ajut->the_post(); ?>
<?php get_template_part( 'template-parts/section', 'eachfund' ); ?>
<?php endwhile;//end of the loop ?>
<?php wp_reset_postdata(); ?>
<?php endif; //end query ajut ?>
<?php
$the_query_ajut = new WP_Query(
array(
'post_type' => 'xarxaprod-ajut',
'posts_per_page' => '-1',
'meta_key' => 'xxp_fund_apply_end', // order by meta key convo apply end
'meta_query' => array(
array( //filter results show only older than today
'key' => 'xxp_fund_apply_end',
'value' => date("Y-m-d"), // consider using date_i18n() https://developer.wordpress.org/reference/functions/date_i18n/
'compare' => '>', //show events from today and later
'type' => 'DATE',
)
),
//https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters
'orderby' => 'meta_value', //order by meta value
'order' => 'ASC', //order ascendent
)
);
?>
<?php if ( $the_query_ajut->have_posts() ) : ?>
<?php while ( $the_query_ajut->have_posts() ) : $the_query_ajut->the_post(); ?>
<?php get_template_part( 'template-parts/section', 'eachfund' ); ?>
<?php endwhile;//end of the loop ?>
<?php wp_reset_postdata(); ?>
<?php endif; //end query ajut ?>
</content> </content>
<section id="filteredfunds" class="xarxaprod-filtered-content xarxaprod-filtered-funds xarxaprod-ajuts-filtrats"> <section id="filteredfunds" class="xarxaprod-filtered-content xarxaprod-filtered-funds xarxaprod-ajuts-filtrats">
</section> </section>

View File

@ -21,6 +21,7 @@ get_header();
<header class="page-header"> <header class="page-header">
<h1><?php //single_term_title( ' ' ); ?></h1> <h1><?php //single_term_title( ' ' ); ?></h1>
this is achive-xarxaprod-convo.php
</header> </header>
<aside id="convosfilter" class="xarxaprod-filter-convos xarxaprod-filtre-convos"> <aside id="convosfilter" class="xarxaprod-filter-convos xarxaprod-filtre-convos">
@ -32,15 +33,13 @@ get_header();
<content class="archive-posts <?php xarxaprod_class_posttype(); ?>"> <content class="archive-posts <?php xarxaprod_class_posttype(); ?>">
<?php <?php
// loop by default in archive.php // very wired, need to output
//if ( have_posts() ) : // 1. today's events 'compare' => '='
// while ( have_posts() ) : the_post(); // 2. then after today 'compare' => '>'
// get_template_part( 'template-parts/section', 'eachconvo' ); //
// endwhile; // if done with '>=' outputs
// the_posts_navigation(); // 1. older dates in asc order
//else : // 2. at the end today
// get_template_part( 'template-parts/content', 'none' );
//endif;
?> ?>
<?php <?php
@ -50,18 +49,49 @@ get_header();
$the_query_convo = new WP_Query( $the_query_convo = new WP_Query(
array( array(
'post_type' => 'xarxaprod-convo', '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' => '-1', //show all
'meta_key' => 'xxp_convo_apply_end', // order by meta key convo apply end
'meta_query' => array( 'meta_query' => array(
array( //filter results show only older than today array( //filter results show only older than today
'key' => 'xxp_convo_apply_end', 'key' => 'xxp_convo_apply_end',
'value' => date("Y-m-d"), // consider using date_i18n() https://developer.wordpress.org/reference/functions/date_i18n/ 'value' => date("Y-m-d"), // consider using date_i18n() https://developer.wordpress.org/reference/functions/date_i18n/
'compare' => '>=', //show events from today and later 'compare' => '=', //show events from today and later
'type' => 'DATE', 'type' => 'DATE',
) )
),
'order_by' => 'meta_value', //order by meta value
'order' => 'ASC', //order ascendent
) )
);
?>
<?php if ( $the_query_convo->have_posts() ) : ?>
<?php while ( $the_query_convo->have_posts() ) : $the_query_convo->the_post(); ?>
<?php get_template_part( 'template-parts/section', 'eachconvo' , $the_query_convo); ?>
<?php endwhile;//end of the loop ?>
<?php wp_reset_postdata(); ?>
<?php endif; ?>
<?php
// https://support.advancedcustomfields.com/forums/topic/wp_query-using-meta_query-for-an-acf-checkbox-field/#post-145830
// https://www.advancedcustomfields.com/resources/checkbox/#query-posts
// https://barn2.com/blog/querying-posts-by-custom-field-acfi/
$the_query_convo = new WP_Query(
array(
'post_type' => 'xarxaprod-convo',
'posts_per_page' => '-1', //show all
'meta_key' => 'xxp_convo_apply_end', // order by meta key convo apply end
'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 from today and later
'type' => 'DATE',
)
),
'order_by' => 'meta_value', //order by meta value
'order' => 'ASC', //order ascendent
) )
); );
?> ?>

View File

@ -38,29 +38,76 @@ get_header();
<content class="archive-posts <?php xarxaprod_class_posttype(); ?>"> <content class="archive-posts <?php xarxaprod_class_posttype(); ?>">
<?php <?php
/* Start the Loop */ /* Start the Loop */
//while ( have_posts() ) :
// the_post();
if( in_category('faq') ) {
while ( have_posts() ) : while ( have_posts() ) :
the_post(); the_post();
get_template_part( 'template-parts/section', 'each-faq' );
endwhile;
the_posts_navigation();
//end if is_category faq
} elseif (in_category( array( 'activitats') ) ) {
//get_template_part( 'template-parts/section', 'each-agenda-entry' );
$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'
)
),
'meta_query' => array(
array( //filter results show only older than today
'key' => 'xxp_agenda_date_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',
)
),
'order_by' => 'meta_value', //order by meta value
'order' => 'ASC', //order ascendent
)
);
if ( $the_query_archive_activitats->have_posts() ) :
while ( $the_query_archive_activitats->have_posts() ) : $the_query_archive_activitats->the_post();
get_template_part( 'template-parts/section', 'each-agenda-entry' );
endwhile;//end of the loop
// pagination will not work for custom_query, why and fix: https://wordpress.stackexchange.com/a/120408
// the_posts_navigation();
endif; //end if the_query_archive_activitats
wp_reset_postdata(); //reset custom query
//end in_category agenda activitats
}else{
//the rest of archives
while ( have_posts() ) :
the_post();
/* /*
* Include the Post-Type-specific template for the content. * Include the Post-Type-specific template for the content.
* If you want to override this in a child theme, then include a file * If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Type name) and that will be used instead. * called content-___.php (where ___ is the Post Type name) and that will be used instead.
*/ */
//get_template_part( 'template-parts/content', get_post_type() ); //get_template_part( 'template-parts/content', get_post_type() );
get_template_part( 'template-parts/section', 'each-entry' );
get_template_part( 'template-parts/section', 'each-agenda-entry' );
endwhile; endwhile;
the_posts_navigation(); the_posts_navigation();
echo '</content>'; }
else : else : //no if have_posts
get_template_part( 'template-parts/content', 'none' );
endif; get_template_part( 'template-parts/content', 'none' ); ?>
?> </content>
<?php endif; //end if have_posts?>
</main><!-- #main --> </main><!-- #main -->

File diff suppressed because one or more lines are too long

View File

@ -110,7 +110,7 @@ get_header();
'terms' => 'activitats' 'terms' => 'activitats'
) )
), ),
//'order_by' => 'meta_value', //order by meta value 'order_by' => 'meta_value', //order by meta value
//'meta_key' => 'xxp_convo_apply_end', // order by meta key convo apply end //'meta_key' => 'xxp_convo_apply_end', // order by meta key convo apply end
'order' => 'ASC', //order ascendent 'order' => 'ASC', //order ascendent
'meta_query' => array( 'meta_query' => array(

View File

@ -19,6 +19,7 @@ get_header();
<?php if ( have_posts() ) : ?> <?php if ( have_posts() ) : ?>
<header class="page-header"> <header class="page-header">
this is convo-search.php
</header><!-- .page-header --> </header><!-- .page-header -->
<?php <?php
while ( have_posts() ) : while ( have_posts() ) :

View File

@ -106,7 +106,7 @@ dd {
padding-left: 0.8em; padding-left: 0.8em;
font-size: $font__size-body*0.8; font-size: $font__size-body*0.8;
} }
ul[id*="menu-social-media"] { ul[id*="menu-social-media"]{
display:flex; display:flex;
flex-flow: row; flex-flow: row;
li { li {
@ -150,4 +150,51 @@ dd {
} }
} }
} }
ul[class*="xarxaprod-associat-social-links"] {
display:flex;
flex-flow: row;
margin: 0;
li {
height: 1.5em;
width: 1.5em;
background-color: inherit;
border-radius: 5em;
border: none !important;
margin-right: 0.3em;
position: relative;
a {
//margin-right: -10000em;
font-size: 0px;
&:before {
content:"";
display: inline-flex;
align-content: center;
justify-content: center;
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
//color: $color__black;
font-size: $font__size-body*1;
//font-weight: 900;
}
&[href*="instagram.com"]:before{
content: "in";
}
&[href*="youtube.com"]:before{
content: "yt";
}
&[href*="facebook.com"]:before{
content: "fb";
}
&[href*="twitter.com"]:before{
content: "tw";
}
&[href*="mastodon"]:before{
content: "mt";
}
}
}
}
} }

View File

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

View File

@ -5,7 +5,7 @@ Theme URI: https://git.hangar.org/xarxaprod/
Author: Hangar.org Tech Lab - hangar.org Author: Hangar.org Tech Lab - hangar.org
Author URI: https://hangar.org 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> 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.0 Version: 1.7.2
Tested up to: 6.5 Tested up to: 6.5
Requires PHP: 7.4 Requires PHP: 7.4
License: GNU General Public License v3 or later License: GNU General Public License v3 or later
@ -1273,6 +1273,59 @@ dd {
ul[id*="menu-social-media"] li a[href*="mastodon"]::before { ul[id*="menu-social-media"] li a[href*="mastodon"]::before {
content: "mt"; content: "mt";
} }
ul[class*="xarxaprod-associat-social-links"] {
display: flex;
flex-flow: row;
margin: 0;
}
ul[class*="xarxaprod-associat-social-links"] li {
height: 1.5em;
width: 1.5em;
background-color: inherit;
border-radius: 5em;
border: none !important;
margin-right: 0.3em;
position: relative;
}
ul[class*="xarxaprod-associat-social-links"] li a {
font-size: 0;
}
ul[class*="xarxaprod-associat-social-links"] li a::before {
content: "";
display: inline-flex;
align-content: center;
justify-content: center;
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
font-size: 1rem;
}
ul[class*="xarxaprod-associat-social-links"] li a[href*="instagram.com"]::before {
content: "in";
}
ul[class*="xarxaprod-associat-social-links"] li a[href*="youtube.com"]::before {
content: "yt";
}
ul[class*="xarxaprod-associat-social-links"] li a[href*="facebook.com"]::before {
content: "fb";
}
ul[class*="xarxaprod-associat-social-links"] li a[href*="twitter.com"]::before {
content: "tw";
}
ul[class*="xarxaprod-associat-social-links"] li a[href*="mastodon"]::before {
content: "mt";
}
} }
/* Make sure embeds and iframes fit their containers. */ /* Make sure embeds and iframes fit their containers. */

File diff suppressed because one or more lines are too long

View File

@ -69,14 +69,22 @@
<?php if( get_field('xxp_associat_tel') ): ?> <?php if( get_field('xxp_associat_tel') ): ?>
<li class="xarxaprod-associat-tel"> <li class="xarxaprod-associat-tel">
<h6>Telèfon:</h6> <h6>Telèfon:</h6>
<p><?php the_field('xxp_associat_tel'); ?></p> <p><a href="tel:<?php the_field('xxp_associat_tel'); ?>"><?php the_field('xxp_associat_tel'); ?></a></p>
</li> </li>
<?php endif; ?> <?php endif; ?>
<?php if( get_field('xxp_associat_xarxes') ): ?> <?php if( have_rows('xxp_asocciat_social_networks') ): ?>
<li class="xarxaprod-associat-tel"> <li class="xarxaprod-associat-social-networks">
<h6>Xarxes socials:</h6> <h6>Xarxes:</h6>
<p><?php the_field('xxp_associat_xarxes'); ?></p> <ul class="xarxaprod-associat-social-links">
<?php while( have_rows('xxp_asocciat_social_networks') ): the_row(); ?>
<li>
<?php $eachlink=get_sub_field('xxp_associat_link_social'); ?>
<a href="<?php echo esc_attr($eachlink);?>" title="<?php echo esc_attr($eachlink);?>"><?php echo esc_attr($eachlink);?></a>
</li>
<?php endwhile; //end while has rows associat social networks ?>
</ul>
</li> </li>
<?php endif; ?> <?php endif; ?>
</ul> </ul>

View File

@ -0,0 +1,35 @@
<?php
/**
* Template part for displaying posts from category "agenda"
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package Xarxaprod_theme
* @used by template-parts/content-post.php
* @shown in : archive category
*
*/
?>
<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>
<?php if ( get_the_excerpt() ){ ?>
<section class="excerpt post-excerpt">
<?php //the_excerpt() ?>
<?php echo wp_trim_words(get_the_excerpt(), 22); // https://developer.wordpress.org/reference/functions/wp_trim_words/?>
</section>
<?php ; }?>
<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>
</article>

View File

@ -0,0 +1,37 @@
<?php
/**
* Template part for displaying posts from category "agenda"
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package Xarxaprod_theme
* @used by template-parts/content-post.php
* @shown in : archive category
*
*/
?>
<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>
<aside class="xarxaprod-faq-info">
</aside>
<?php if ( get_the_excerpt() ){ ?>
<section class="excerpt post-excerpt">
<?php //the_excerpt() ?>
<?php echo wp_trim_words(get_the_excerpt(), 22); // https://developer.wordpress.org/reference/functions/wp_trim_words/?>
</section>
<?php ; }?>
<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>
</article>