Prime modifiche per risolvere issue segnalate

This commit is contained in:
ulaulaman 2021-05-08 01:15:54 +02:00
parent d6b7992b5b
commit f226e36bd5
1 changed files with 17 additions and 18 deletions

View File

@ -198,23 +198,22 @@ add_shortcode( 'sbdidattica', function () {
$collaborazione = null; $collaborazione = null;
$terms = get_the_terms ( $post->ID, 'collaborazioni' ); $terms = get_the_terms ( $post->ID, 'collaborazioni' );
if ( empty($terms) ) {
$collaborazione = null;
} else {
$numcat = sizeof( $terms ); $numcat = sizeof( $terms );
$i = 0; $i = 0;
foreach ( $terms as $term ) { foreach ( $terms as $term ) {
$term_link = get_term_link( $term, 'collaborazioni' ); $term_link = get_term_link( $term, 'collaborazioni' );
$i++; $i++;
if ( $i < $numcat ) { $ente .= '<a rel="tag" href="'.$term_link.'"><img src="https://edu.inaf.it/wp-content/plugins/eduinaf/images/coll/'.$term->slug.'.png" width="90%"';
$ente = $ente.'<a rel="tag" href="'.$term_link.'"><img src="https://edu.inaf.it/wp-content/plugins/eduinaf/images/coll/'.$term->slug.'.png" width="90%" style="padding-bottom:10px;" /></a><br/>'; if ( $i < $numcat )
} else { $ente .= 'style="padding-bottom:10px;" /></a><br/>';
$ente = $ente.'<a rel="tag" href="'.$term_link.'"><img src="https://edu.inaf.it/wp-content/plugins/eduinaf/images/coll/'.$term->slug.'.png" width="90%" /></a>'; else
$ente .= ' /></a>';
} }
}
if ( $i <> 0 ) {
$collaborazione = '<p><strong>In collaborazione con</strong>:<br/>'.$ente.'</p>'; $collaborazione = '<p><strong>In collaborazione con</strong>:<br/>'.$ente.'</p>';
$outnew = $outnew.$collaborazione; $outnew = $outnew.$collaborazione;
} else {
$outnew = $outnew;
} }
$licenza = '<p><a href="http://creativecommons.org/licenses/by-nc/4.0/" target="cc"><img src="https://i.creativecommons.org/l/by-nc/4.0/88x31.png" /></a><br/>Quest\'opera è distribuita con <a href="http://creativecommons.org/licenses/by-nc/4.0/" target="cc">Licenza Creative Commons Attribuzione - Non commerciale 4.0 Internazionale</a>.'; $licenza = '<p><a href="http://creativecommons.org/licenses/by-nc/4.0/" target="cc"><img src="https://i.creativecommons.org/l/by-nc/4.0/88x31.png" /></a><br/>Quest\'opera è distribuita con <a href="http://creativecommons.org/licenses/by-nc/4.0/" target="cc">Licenza Creative Commons Attribuzione - Non commerciale 4.0 Internazionale</a>.';