created new data fields in convo and styles

This commit is contained in:
jorge 2024-04-03 15:07:53 +02:00
parent 4c0d0df31e
commit 077bbebf99
11 changed files with 385 additions and 239 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.5.1 Version: 1.6.0
Tested up to: 6.4 Tested up to: 6.4
Requires PHP: 7.4 Requires PHP: 7.4
License: GNU General Public License v3 or later License: GNU General Public License v3 or later
@ -2095,13 +2095,20 @@ Add your custom styles in this file so it is easier to update the theme.
* * * * * * * */ * * * * * * * */
/* used in /* used in
* ./template-parts/section-eachpost.php * template-parts/section-eachpost.php
* */ * */
/* used in /* used in
* ./template-parts/content-xarxaprod-ajut.php * template-parts/content-xarxaprod-ajut.php
* ./template-parts/content-xarxaprod-convo.php * template-parts/content-xarxaprod-convo.php
* ./template-parts/section-eachpost.php * template-parts/section-eachpost.php
* */
/* used in
* archive-xarxaprod-convo.php
* page-template/convo-search.php
* template-parts/content-xarxaprod-convo.php
* template-parts/section-eachconvo.php
* */ * */
/* used in /* used in
@ -2317,48 +2324,11 @@ Add your custom styles in this file so it is easier to update the theme.
font-size: 0.8rem; font-size: 0.8rem;
} }
.edit-post-visual-editor__content-area .editor-styles-wrapper article.xarxaprod-convo > .xarxaprod-convo-info-fields {
padding-top: 2rem;
padding-bottom: 2rem;
}
.edit-post-visual-editor__content-area .editor-styles-wrapper article.xarxaprod-convo > .entry-footer {
padding-top: 2rem;
}
.edit-post-visual-editor__content-area .editor-styles-wrapper article.xarxaprod-convo > .entry-footer .xarxaprod-more-convos-header {
padding: 2rem 0;
font-size: 1.6rem;
text-align: center;
text-transform: uppercase;
}
.edit-post-visual-editor__content-area .editor-styles-wrapper article.xarxaprod-convo > .entry-footer .last-convos {
padding: 2rem 0;
border-top: 0.05rem solid #000;
}
.edit-post-visual-editor__content-area .editor-styles-wrapper article.xarxaprod-convo > .entry-footer .last-convos > header {
display: none;
}
.edit-post-visual-editor__content-area .editor-styles-wrapper .xarxaprod-convo-info-fields,
.edit-post-visual-editor__content-area .editor-styles-wrapper .xarxaprod-agenda-info {
margin-bottom: 2em;
}
.edit-post-visual-editor__content-area .editor-styles-wrapper .xarxaprod-convo-info-fields li, .edit-post-visual-editor__content-area .editor-styles-wrapper .xarxaprod-convo-info-fields li,
.edit-post-visual-editor__content-area .editor-styles-wrapper .xarxaprod-agenda-info li { .edit-post-visual-editor__content-area .editor-styles-wrapper .xarxaprod-agenda-info li {
display: grid;
grid-template-columns: 0.75fr 2.25fr;
padding: 0.2em 0; padding: 0.2em 0;
border-top: 0.05rem solid #000;
font-size: 1rem;
}
.edit-post-visual-editor__content-area .editor-styles-wrapper .xarxaprod-convo-info-fields li:last-of-type,
.edit-post-visual-editor__content-area .editor-styles-wrapper .xarxaprod-agenda-info li:last-of-type {
border-bottom: 0.05rem solid #000; border-bottom: 0.05rem solid #000;
font-size: 1rem;
} }
.edit-post-visual-editor__content-area .editor-styles-wrapper .xarxaprod-convo-info-fields li .xarxaprod-label li, .edit-post-visual-editor__content-area .editor-styles-wrapper .xarxaprod-convo-info-fields li .xarxaprod-label li,
@ -2379,16 +2349,12 @@ Add your custom styles in this file so it is easier to update the theme.
} }
.edit-post-visual-editor__content-area .editor-styles-wrapper .xarxaprod-convo-info-fields dt, .edit-post-visual-editor__content-area .editor-styles-wrapper .xarxaprod-convo-info-fields dt,
.edit-post-visual-editor__content-area .editor-styles-wrapper .xarxaprod-agenda-info dt {
grid-row: 1 / 1;
font-weight: 100;
}
.edit-post-visual-editor__content-area .editor-styles-wrapper .xarxaprod-convo-info-fields dd, .edit-post-visual-editor__content-area .editor-styles-wrapper .xarxaprod-convo-info-fields dd,
.edit-post-visual-editor__content-area .editor-styles-wrapper .xarxaprod-agenda-info dt,
.edit-post-visual-editor__content-area .editor-styles-wrapper .xarxaprod-agenda-info dd { .edit-post-visual-editor__content-area .editor-styles-wrapper .xarxaprod-agenda-info dd {
grid-row: 1 / 2; display: inline;
font-weight: 100;
margin: 0; margin: 0;
font-weight: 700;
} }
.edit-post-visual-editor__content-area .editor-styles-wrapper .xarxaprod-convo-info-fields p, .edit-post-visual-editor__content-area .editor-styles-wrapper .xarxaprod-convo-info-fields p,
@ -2397,6 +2363,61 @@ Add your custom styles in this file so it is easier to update the theme.
margin: 0; margin: 0;
} }
.edit-post-visual-editor__content-area .editor-styles-wrapper .xarxaprod-card-each.xarxaprod-convo .entry-title {
display: inline-flex;
align-items: flex-end;
min-height: 3.6rem;
}
.edit-post-visual-editor__content-area .editor-styles-wrapper .single-xarxaprod-convo article.xarxaprod-convo > .xarxaprod-convo-info-fields {
padding-top: 2rem;
padding-bottom: 2rem;
}
.edit-post-visual-editor__content-area .editor-styles-wrapper .single-xarxaprod-convo article.xarxaprod-convo > .entry-footer {
padding-top: 2rem;
}
.edit-post-visual-editor__content-area .editor-styles-wrapper .single-xarxaprod-convo article.xarxaprod-convo > .entry-footer .xarxaprod-more-convos-header {
padding: 2rem 0;
font-size: 1.6rem;
text-align: center;
text-transform: uppercase;
}
.edit-post-visual-editor__content-area .editor-styles-wrapper .single-xarxaprod-convo article.xarxaprod-convo > .entry-footer .last-convos {
padding: 2rem 0;
border-top: 0.05rem solid #000;
}
.edit-post-visual-editor__content-area .editor-styles-wrapper .single-xarxaprod-convo article.xarxaprod-convo > .entry-footer .last-convos > header {
display: none;
}
.edit-post-visual-editor__content-area .editor-styles-wrapper .single-xarxaprod-convo .xarxaprod-convo-info-fields li,
.edit-post-visual-editor__content-area .editor-styles-wrapper .single-xarxaprod-convo .xarxaprod-agenda-info li {
display: grid;
grid-template-columns: 0.75fr 2.25fr;
}
.edit-post-visual-editor__content-area .editor-styles-wrapper .single-xarxaprod-convo .xarxaprod-convo-info-fields li:first-of-type,
.edit-post-visual-editor__content-area .editor-styles-wrapper .single-xarxaprod-convo .xarxaprod-agenda-info li:first-of-type {
border-top: 0.05rem solid #000;
}
.edit-post-visual-editor__content-area .editor-styles-wrapper .single-xarxaprod-convo .xarxaprod-convo-info-fields dt,
.edit-post-visual-editor__content-area .editor-styles-wrapper .single-xarxaprod-convo .xarxaprod-agenda-info dt {
grid-row: 1 / 1;
font-weight: 100;
}
.edit-post-visual-editor__content-area .editor-styles-wrapper .single-xarxaprod-convo .xarxaprod-convo-info-fields dd,
.edit-post-visual-editor__content-area .editor-styles-wrapper .single-xarxaprod-convo .xarxaprod-agenda-info dd {
grid-row: 1 / 2;
margin: 0;
font-weight: 700;
}
.edit-post-visual-editor__content-area .editor-styles-wrapper .single-xarxaprod-associat .xarxaprod-associat > section { .edit-post-visual-editor__content-area .editor-styles-wrapper .single-xarxaprod-associat .xarxaprod-associat > section {
margin-top: 4em; margin-top: 4em;
} }
@ -2556,6 +2577,8 @@ Add your custom styles in this file so it is easier to update the theme.
} }
.edit-post-visual-editor__content-area .editor-styles-wrapper .xarxaprod-card-each.category-activitats .entry-title { .edit-post-visual-editor__content-area .editor-styles-wrapper .xarxaprod-card-each.category-activitats .entry-title {
display: inline-flex;
align-items: flex-end;
min-height: 5.5rem; min-height: 5.5rem;
overflow: hidden; overflow: hidden;
border: none; border: none;
@ -2682,8 +2705,8 @@ Add your custom styles in this file so it is easier to update the theme.
@media screen and (min-width: 48em) { @media screen and (min-width: 48em) {
.edit-post-visual-editor__content-area .editor-styles-wrapper .xarxaprod-convo-info-fields li, .edit-post-visual-editor__content-area .editor-styles-wrapper .single-xarxaprod-convo .xarxaprod-convo-info-fields li,
.edit-post-visual-editor__content-area .editor-styles-wrapper .xarxaprod-agenda-info li { .edit-post-visual-editor__content-area .editor-styles-wrapper .single-xarxaprod-convo .xarxaprod-agenda-info li {
font-size: 1.5rem; font-size: 1.5rem;
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -69,7 +69,7 @@ get_header();
<content class="archive-posts archive-xarxaprod-convo <?php //xarxaprod_class_posttype(); ?>"> <content class="archive-posts archive-xarxaprod-convo <?php //xarxaprod_class_posttype(); ?>">
<?php while ( $the_query_convo->have_posts() ) : $the_query_convo->the_post(); ?> <?php while ( $the_query_convo->have_posts() ) : $the_query_convo->the_post(); ?>
<?php get_template_part( 'template-parts/section', 'eachconvo' ); ?> <?php get_template_part( 'template-parts/section', 'eachconvo' , $the_query_convo); ?>
<?php endwhile;//end of the loop ?> <?php endwhile;//end of the loop ?>
<?php wp_reset_postdata(); ?> <?php wp_reset_postdata(); ?>

View File

@ -93,7 +93,7 @@
} }
/* used in /* used in
* ./template-parts/section-eachpost.php * template-parts/section-eachpost.php
* */ * */
.xarxaprod-card-each { .xarxaprod-card-each {
display: flex; display: flex;
@ -125,9 +125,9 @@
} }
/* used in /* used in
* ./template-parts/content-xarxaprod-ajut.php * template-parts/content-xarxaprod-ajut.php
* ./template-parts/content-xarxaprod-convo.php * template-parts/content-xarxaprod-convo.php
* ./template-parts/section-eachpost.php * template-parts/section-eachpost.php
* */ * */
.xarxaprod-fund-info-fields, .xarxaprod-fund-info-fields,
.xarxaprod-fund-info-contact-fields { .xarxaprod-fund-info-contact-fields {
@ -178,40 +178,19 @@
font-size: $font__size-body*0.8; font-size: $font__size-body*0.8;
} }
} }
article.xarxaprod-convo { /* used in
> .xarxaprod-convo-info-fields { * archive-xarxaprod-convo.php
padding-top: 2rem; * page-template/convo-search.php
padding-bottom: 2rem; * template-parts/content-xarxaprod-convo.php
} * template-parts/section-eachconvo.php
> .entry-footer { * */
padding-top: 2rem;
.xarxaprod-more-convos-header {
padding: 2rem 0;
font-size: $font__size-body*1.6;
text-align: center;
text-transform: uppercase;
}
.last-convos{
padding: 2rem 0;
border-top: $border__line;
> header {
display:none;
}
}
}
}
.xarxaprod-convo-info-fields, .xarxaprod-convo-info-fields,
.xarxaprod-agenda-info { .xarxaprod-agenda-info {
margin-bottom: 2em; //margin-bottom: 2em;
li { li {
display:grid;
grid-template-columns: 0.75fr 2.25fr;
padding: 0.2em 0; padding: 0.2em 0;
border-top: $border__line; border-bottom: $border__line;
font-size: $font__size-body*1; font-size: $font__size-body*1;
&:last-of-type{
border-bottom: $border__line;
}
.xarxaprod-label li { .xarxaprod-label li {
display: inherit; display: inherit;
margin: 0; margin: 0;
@ -226,20 +205,71 @@
} }
} }
} }
dt { dt,dd {
grid-row: 1 / 1; display: inline;
font-weight: 100; font-weight: 100;
}
dd {
grid-row: 1 / 2;
margin: 0; margin: 0;
font-weight: 700; span {
//padding-right: 0.5rem;
}
} }
p { p {
grid-row: 1 / 2; grid-row: 1 / 2;
margin: 0; margin: 0;
} }
} }
.xarxaprod-card-each {
&.xarxaprod-convo {
.entry-title {
display: inline-flex;
align-items: flex-end;
min-height: $font__size-body * 3.6;
}
}
}
.single-xarxaprod-convo {
article.xarxaprod-convo {
> .xarxaprod-convo-info-fields {
padding-top: 2rem;
padding-bottom: 2rem;
}
> .entry-footer {
padding-top: 2rem;
.xarxaprod-more-convos-header {
padding: 2rem 0;
font-size: $font__size-body*1.6;
text-align: center;
text-transform: uppercase;
}
.last-convos{
padding: 2rem 0;
border-top: $border__line;
> header {
display:none;
}
}
}
}
.xarxaprod-convo-info-fields,
.xarxaprod-agenda-info {
li {
display:grid;
grid-template-columns: 0.75fr 2.25fr;
&:first-of-type{
border-top: $border__line;
}
}
dt {
grid-row: 1 / 1;
font-weight: 100;
}
dd {
grid-row: 1 / 2;
margin: 0;
font-weight: 700;
}
}
}
/* used in /* used in
* template-parts/content-xarxaprod-associat.php * template-parts/content-xarxaprod-associat.php
@ -413,6 +443,8 @@
&.category-activitats { &.category-activitats {
justify-content: flex-start; justify-content: flex-start;
.entry-title { .entry-title {
display: inline-flex;
align-items: flex-end;
min-height: $font__size-body * 5.5; min-height: $font__size-body * 5.5;
overflow: hidden; overflow: hidden;
border: none; border: none;
@ -542,10 +574,12 @@
.archive-posts { .archive-posts {
//grid-template-columns: repeat(2 , minmax(0,1fr)); //grid-template-columns: repeat(2 , minmax(0,1fr));
} }
.xarxaprod-convo-info-fields, .single-xarxaprod-convo {
.xarxaprod-agenda-info { .xarxaprod-convo-info-fields,
li { .xarxaprod-agenda-info {
font-size: $font__size-body*1.5; li {
font-size: $font__size-body*1.5;
}
} }
} }

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.5.1 Version: 1.6.0
Tested up to: 6.4 Tested up to: 6.4
Requires PHP: 7.4 Requires PHP: 7.4
License: GNU General Public License v3 or later License: GNU General Public License v3 or later

126
style.css
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.5.1 Version: 1.6.0
Tested up to: 6.4 Tested up to: 6.4
Requires PHP: 7.4 Requires PHP: 7.4
License: GNU General Public License v3 or later License: GNU General Public License v3 or later
@ -2036,7 +2036,7 @@ textarea {
} }
/* used in /* used in
* ./template-parts/section-eachpost.php * template-parts/section-eachpost.php
* */ * */
.xarxaprod-card-each { .xarxaprod-card-each {
display: flex; display: flex;
@ -2074,9 +2074,9 @@ textarea {
} }
/* used in /* used in
* ./template-parts/content-xarxaprod-ajut.php * template-parts/content-xarxaprod-ajut.php
* ./template-parts/content-xarxaprod-convo.php * template-parts/content-xarxaprod-convo.php
* ./template-parts/section-eachpost.php * template-parts/section-eachpost.php
* */ * */
.xarxaprod-fund-info-fields, .xarxaprod-fund-info-fields,
.xarxaprod-fund-info-contact-fields { .xarxaprod-fund-info-contact-fields {
@ -2139,48 +2139,17 @@ textarea {
font-size: 0.8rem; font-size: 0.8rem;
} }
article.xarxaprod-convo > .xarxaprod-convo-info-fields { /* used in
padding-top: 2rem; * archive-xarxaprod-convo.php
padding-bottom: 2rem; * page-template/convo-search.php
} * template-parts/content-xarxaprod-convo.php
* template-parts/section-eachconvo.php
article.xarxaprod-convo > .entry-footer { * */
padding-top: 2rem;
}
article.xarxaprod-convo > .entry-footer .xarxaprod-more-convos-header {
padding: 2rem 0;
font-size: 1.6rem;
text-align: center;
text-transform: uppercase;
}
article.xarxaprod-convo > .entry-footer .last-convos {
padding: 2rem 0;
border-top: 0.05rem solid #000;
}
article.xarxaprod-convo > .entry-footer .last-convos > header {
display: none;
}
.xarxaprod-convo-info-fields,
.xarxaprod-agenda-info {
margin-bottom: 2em;
}
.xarxaprod-convo-info-fields li, .xarxaprod-convo-info-fields li,
.xarxaprod-agenda-info li { .xarxaprod-agenda-info li {
display: grid;
grid-template-columns: 0.75fr 2.25fr;
padding: 0.2em 0; padding: 0.2em 0;
border-top: 0.05rem solid #000;
font-size: 1rem;
}
.xarxaprod-convo-info-fields li:last-of-type,
.xarxaprod-agenda-info li:last-of-type {
border-bottom: 0.05rem solid #000; border-bottom: 0.05rem solid #000;
font-size: 1rem;
} }
.xarxaprod-convo-info-fields li .xarxaprod-label li, .xarxaprod-convo-info-fields li .xarxaprod-label li,
@ -2201,16 +2170,12 @@ textarea {
} }
.xarxaprod-convo-info-fields dt, .xarxaprod-convo-info-fields dt,
.xarxaprod-agenda-info dt {
grid-row: 1 / 1;
font-weight: 100;
}
.xarxaprod-convo-info-fields dd, .xarxaprod-convo-info-fields dd,
.xarxaprod-agenda-info dt,
.xarxaprod-agenda-info dd { .xarxaprod-agenda-info dd {
grid-row: 1 / 2; display: inline;
font-weight: 100;
margin: 0; margin: 0;
font-weight: 700;
} }
.xarxaprod-convo-info-fields p, .xarxaprod-convo-info-fields p,
@ -2219,6 +2184,61 @@ textarea {
margin: 0; margin: 0;
} }
.xarxaprod-card-each.xarxaprod-convo .entry-title {
display: inline-flex;
align-items: flex-end;
min-height: 3.6rem;
}
.single-xarxaprod-convo article.xarxaprod-convo > .xarxaprod-convo-info-fields {
padding-top: 2rem;
padding-bottom: 2rem;
}
.single-xarxaprod-convo article.xarxaprod-convo > .entry-footer {
padding-top: 2rem;
}
.single-xarxaprod-convo article.xarxaprod-convo > .entry-footer .xarxaprod-more-convos-header {
padding: 2rem 0;
font-size: 1.6rem;
text-align: center;
text-transform: uppercase;
}
.single-xarxaprod-convo article.xarxaprod-convo > .entry-footer .last-convos {
padding: 2rem 0;
border-top: 0.05rem solid #000;
}
.single-xarxaprod-convo article.xarxaprod-convo > .entry-footer .last-convos > header {
display: none;
}
.single-xarxaprod-convo .xarxaprod-convo-info-fields li,
.single-xarxaprod-convo .xarxaprod-agenda-info li {
display: grid;
grid-template-columns: 0.75fr 2.25fr;
}
.single-xarxaprod-convo .xarxaprod-convo-info-fields li:first-of-type,
.single-xarxaprod-convo .xarxaprod-agenda-info li:first-of-type {
border-top: 0.05rem solid #000;
}
.single-xarxaprod-convo .xarxaprod-convo-info-fields dt,
.single-xarxaprod-convo .xarxaprod-agenda-info dt {
grid-row: 1 / 1;
font-weight: 100;
}
.single-xarxaprod-convo .xarxaprod-convo-info-fields dd,
.single-xarxaprod-convo .xarxaprod-agenda-info dd {
grid-row: 1 / 2;
margin: 0;
font-weight: 700;
}
/* used in /* used in
* template-parts/content-xarxaprod-associat.php * template-parts/content-xarxaprod-associat.php
* * * * * * * * * */ * * * * * * * * * */
@ -2404,6 +2424,8 @@ textarea {
} }
.xarxaprod-card-each.category-activitats .entry-title { .xarxaprod-card-each.category-activitats .entry-title {
display: inline-flex;
align-items: flex-end;
min-height: 5.5rem; min-height: 5.5rem;
overflow: hidden; overflow: hidden;
border: none; border: none;
@ -2533,8 +2555,8 @@ textarea {
@media screen and (min-width: 48em) { @media screen and (min-width: 48em) {
.xarxaprod-convo-info-fields li, .single-xarxaprod-convo .xarxaprod-convo-info-fields li,
.xarxaprod-agenda-info li { .single-xarxaprod-convo .xarxaprod-agenda-info li {
font-size: 1.5rem; font-size: 1.5rem;
} }

File diff suppressed because one or more lines are too long

View File

@ -15,58 +15,54 @@
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?> <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
</header><!-- .entry-header --> </header><!-- .entry-header -->
<aside cass="xarxaprod-espai-image">
<?php
if( get_field('xxp_convo_espai_associat') ):
// read here howto
// https://www.advancedcustomfields.com/resources/relationship/#display-list-of-posts-with-setuppostdata
$espai_associat_posts = get_field('xxp_convo_espai_associat');
if( $espai_associat_posts ):
foreach( $espai_associat_posts as $post ):
// Setup this post for WP functions (variable must be named $post).
setup_postdata($post); ?>
<?php
// search and output images
// check if has post_thumbnail
if ( has_post_thumbnail() ){
xarxaprod_post_thumbnail('full');
} else { ?>
<?php if( have_rows('xxp_associat_gallery_images') ){ ?>
<section class="xarxaprod-associat-gallery-images">
<ul class="xarxaprod-associat-slides">
<?php while( have_rows('xxp_associat_gallery_images') ): the_row(); ?>
<?php $image=get_sub_field('xxp_associat_image'); ?>
<li id="<?php echo acf_esc_html( $image['filename'] );?>" class="xarxaprod-associat-image">
<?php //print_r( $image ); //echo the whole array ?>
<?php //print_r( $image['ID'] ); // echo one fiels of the array?>
<?php echo wp_get_attachment_image( $image['ID'], 'full' ); ?>
<p class="caption"><?php //echo acf_esc_html( $image['caption'] );?></p>
</li>
<?php endwhile; //end while has rows ?>
</ul>
</section>
<?php }; //end if xxp_associat_gallery_images ?>
<aside cass="xarxaprod-espai-image"> <?php };//end has_post_thumbnail ?>
<?php
if( get_field('xxp_convo_espai_associat') ):
// read here howto
// https://www.advancedcustomfields.com/resources/relationship/#display-list-of-posts-with-setuppostdata
$espai_associat_posts = get_field('xxp_convo_espai_associat');
if( $espai_associat_posts ):
foreach( $espai_associat_posts as $post ):
// Setup this post for WP functions (variable must be named $post).
setup_postdata($post); ?>
<?php
// search and output images
// check if has post_thumbnail
if ( has_post_thumbnail() ){
xarxaprod_post_thumbnail('full');
} else { ?>
<?php if( have_rows('xxp_associat_gallery_images') ){ ?>
<section class="xarxaprod-associat-gallery-images">
<ul class="xarxaprod-associat-slides">
<?php while( have_rows('xxp_associat_gallery_images') ): the_row(); ?>
<?php $image=get_sub_field('xxp_associat_image'); ?>
<li id="<?php echo acf_esc_html( $image['filename'] );?>" class="xarxaprod-associat-image">
<?php //print_r( $image ); //echo the whole array ?>
<?php //print_r( $image['ID'] ); // echo one fiels of the array?>
<?php echo wp_get_attachment_image( $image['ID'], 'full' ); ?>
<p class="caption"><?php //echo acf_esc_html( $image['caption'] );?></p>
</li>
<?php endwhile; //end while has rows ?>
</ul>
</section>
<?php }; //end if xxp_associat_gallery_images ?>
<?php };//end has_post_thumbnail ?>
<?php endforeach;
// Reset the global post object so that the rest of the page works correctly.
wp_reset_postdata();
endif;
endif;
?>
</aside>
<?php endforeach;
// Reset the global post object so that the rest of the page works correctly.
wp_reset_postdata();
endif;
endif;
?>
</aside>
<section class="xarxaprod-convo-info-fields"> <section class="xarxaprod-convo-info-fields">
<ul> <ul>
<?php if( get_field('xxp_convo_espai_associat') ): <?php if( get_field('xxp_convo_espai_associat') ):
// read here howto // read here howto
// https://www.advancedcustomfields.com/resources/relationship/#display-list-of-posts-with-setuppostdata // https://www.advancedcustomfields.com/resources/relationship/#display-list-of-posts-with-setuppostdata
$espai_associat_posts = get_field('xxp_convo_espai_associat'); $espai_associat_posts = get_field('xxp_convo_espai_associat');
if( $espai_associat_posts ): if( $espai_associat_posts ):
foreach( $espai_associat_posts as $post ): foreach( $espai_associat_posts as $post ):

View File

@ -6,19 +6,63 @@
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/ * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
* *
* @package Xarxaprod_theme * @package Xarxaprod_theme
* @used_by page-template/convo-serach.php
* @used_by page-template/convo-archive.php
*
*/ */
?> ?>
<article id="post-<?php the_ID(); ?>" <?php post_class('xarxaprod-card-each'); ?> > <article id="post-<?php the_ID(); ?>" <?php post_class('xarxaprod-card-each'); ?> >
<h3 class="entry-title"> <h3 class="entry-title">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" rel="bookmark"> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" rel="bookmark">
<?php the_title(); ?> <?php the_title(); ?>
</a> </a>
</h3> </h3>
<section class="xarxaprod-convo-info-fields">
<ul>
<li class="xarxaprod-convo-info-date">
<?php if( get_field('xxp_convo_apply_begin') || get_field('xxp_convo_apply_end') ): ?>
<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>
<?php endif; ?>
</li>
<?php if( ! get_field('xxp_convo_espai_associat') ): ?>
<?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.?>
<?php endif; //end get_field('xxp_convo_espai_associat') ?>
</ul>
</section>
<?php if( get_field('xxp_convo_apply_end') ): ?>
<h6 class="xarxaprod-convo-date"><?php the_field('xxp_convo_apply_end'); ?></h6>
<?php endif; ?>
<section class="excerpt post-excerpt"> <section class="excerpt post-excerpt">
<?php //the_excerpt() ?> <?php //the_excerpt() ?>
@ -27,29 +71,24 @@
</section> </section>
<aside> <aside>
<?php get_template_part( <?php get_template_part(
'template-parts/section', 'template-parts/section',
'list-checkbox', 'list-checkbox',
array('iterate_field' => 'xxp_convo_field') array('iterate_field' => 'xxp_convo_field')
); ?> ); ?>
<?php get_template_part( <?php get_template_part(
'template-parts/section', 'template-parts/section',
'list-checkbox', 'list-checkbox',
array('iterate_field' => 'xxp_convo_territory') array('iterate_field' => 'xxp_convo_territory')
); ?> ); ?>
<?php get_template_part( <?php get_template_part(
'template-parts/section', 'template-parts/section',
'list-checkbox', 'list-checkbox',
array('iterate_field' => 'xxp_convo_service') array('iterate_field' => 'xxp_convo_service')
); ?> ); ?>
<?php get_template_part(
'template-parts/section',
'list-checkbox',
array('iterate_field' => 'xxp_convo_center')
); ?>
</aside> </aside>
<nav class="more-link"> <nav class="more-link">

View File

@ -88,17 +88,49 @@
</a> </a>
</header><!-- .entry-header --> </header><!-- .entry-header -->
<?php if( get_field('xxp_convo_apply_begin') || get_field('xxp_convo_apply_end') ): ?>
<h6 class="xarxaprod-deadline">Deadline: <section class="xarxaprod-convo-info-fields">
<?php //the_field('xxp_convo_apply_begin'); ?> <ul>
<?php the_field('xxp_convo_apply_end'); ?> <li class="xarxaprod-convo-info-date">
</h6> <?php if( get_field('xxp_convo_apply_begin') || get_field('xxp_convo_apply_end') ): ?>
<?php endif; ?> <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>
<?php endif; ?>
</li>
<?php if( ! get_field('xxp_convo_espai_associat') ): ?>
<?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.?>
<?php endif; //end get_field('xxp_convo_espai_associat') ?>
</ul>
</section>
<?php if( get_field('xxp_convo_apply_text') ): ?>
<h6 class="item-xxp_convo_apply_text"><?php the_field('xxp_convo_apply_text'); ?></h6>
<?php endif; ?>
<section class="excerpt post-excerpt"> <section class="excerpt post-excerpt">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" rel="bookmark" class=""> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" rel="bookmark" class="">