2021-02-18 14:09:56 +01:00
< li id = " post-<?php the_ID(); ?> " < ? php echo 'class ="boxentry ' . $tipus ; if ( in_category ( " destacado " )) echo ' destacat' ; echo '"' ; ?> >
2022-07-19 00:27:21 +02:00
< ? php //echo $category; ?>
< ? php //echo $tipus; ?>
2021-02-18 14:09:56 +01:00
<!-- les pàgines fixes ( no categories ni artistes ) -->
< ? php if (( ! $category ) and ( $tipus == 'pag' )) : ?>
< h2 class = " box <?php echo $tipus ;?> " >< a href = " <?php the_permalink(); ?> " title = " <?php printf( esc_attr__( 'Permalink to %s', 'hangar' ), the_title_attribute( 'echo=0' ) ); ?> " rel = " bookmark " >< ? php the_title () ; ?> </a> </h2>
2022-07-19 00:27:21 +02:00
< ? php $contingut = get_the_content_with_formatting (); //funció que està a functions.php permet mostrar links i html del contingut, client ho volia ?>
< div class = " contingut plus " >
< ? php echo $contingut ; ?>
</ div >
2021-02-18 14:09:56 +01:00
< div class = " boxpeu " >
2022-07-19 00:27:21 +02:00
< a href = " <?php the_permalink(); ?> " class = " peubox " title = " <?php printf( esc_attr__( 'Permalink to %s', 'hangar' ), the_title_attribute( 'echo=0' ) ); ?> " rel = " bookmark " >< img alt = " enllaç " src = " <?php echo get_template_directory_uri() . '/images/fletxalink.png';?> " /></ a >
</ div >
<!-- els artistes -->
2021-02-18 14:09:56 +01:00
< ? php elseif (( ! $category ) and (( $tipus == 'art' )) or ( $tipus == 'obra' )) : ?>
2022-07-19 00:27:21 +02:00
2021-02-18 14:09:56 +01:00
< div class = " head-entry " >
2022-07-19 00:27:21 +02:00
< ? php if ( is_home ()) : ?>
< span class = 'cat' >
< a href = " <?php echo get_permalink(2);?> " >< ? php echo get_the_title ( 2 ); ?> </a>
</ span >
< h2 class = " box <?php echo $tipus ;?> " >< a href = " <?php the_permalink(); ?> " title = " <?php printf( esc_attr__( 'Permalink to %s', 'hangar' ), the_title_attribute( 'echo=0' ) ); ?> " rel = " bookmark " >< ? php the_title () ; ?> </a> </h2>
< ? php else : ?>
< h3 class = " box <?php echo $tipus ;?> " >< a href = " <?php the_permalink(); ?> " title = " <?php printf( esc_attr__( 'Permalink to %s', 'hangar' ), the_title_attribute( 'echo=0' ) ); ?> " rel = " bookmark " >< ? php the_title () ; ?> </a> </h3>
< ? php endif ; ?>
2021-02-18 14:09:56 +01:00
</ div >
2022-09-12 10:49:39 +02:00
< ? php if ( $tipus == 'art' ) : ?>
< ? php if ( get_post_meta ( $post -> ID , 'autor_tipo_resid' , true ) && get_post_meta ( $post -> ID , 'autor_data_resid' , true )) : ?>
< p class = " meta box " >
< ? php echo __ ( get_post_meta ( $post -> ID , 'autor_tipo_resid' , true )) ?>
< br />
< ? php echo __ ( get_post_meta ( $post -> ID , 'autor_data_resid' , true )) ?>
</ p >
< ? php else : ?>
< p class = " meta box novista " ></ p >
< ? php endif ; ?>
2022-07-19 00:27:21 +02:00
< ? php else : ?>
2022-09-12 10:49:39 +02:00
< p class = " meta box " >< ? php echo get_post_meta ( $post -> ID , 'data_obra' , true ) ?> </p>
< ? php endif ; ?>
< ? php if ( has_post_thumbnail () ) : ?>
< a href = " <?php the_permalink(); ?> " title = " <?php the_title_attribute(); ?> " >
< ? php the_post_thumbnail ( 'artists-thumb' ); ?>
< ? php //the_post_thumbnail('thumbnail'); ?>
</ a >
< ? php else : ?>
< img class = " noimatge gran " width = " 200 " height = " 230 " title = " imatge no disponible " alt = " imatge no disponible " src = " <?php echo get_template_directory_uri() .'/images/noimatgegran.jpg';?> " />
2022-07-19 00:27:21 +02:00
< ? php endif ; ?>
2022-09-12 10:49:39 +02:00
< div class = " boxpeu " >
<!-- la fletxeta link al post / pàgina -->
< a href = " <?php the_permalink(); ?> " class = " peubox " title = " <?php printf( esc_attr__( 'Permalink to %s', 'hangar' ), the_title_attribute( 'echo=0' ) ); ?> " rel = " bookmark " >< img alt = " enllaç " src = " <?php echo get_template_directory_uri() . '/images/fletxalink.png';?> " /></ a >
2022-07-19 00:27:21 +02:00
2022-09-12 10:49:39 +02:00
< ? php if ( is_home ()) : ?>
<!-- els quadrets link a la categoria pare -->
< a href = " <?php echo get_permalink(2); ?> " class = " peudret " title = " <?php echo get_the_title(2); ?> " rel = " bookmark " >< img alt = " enllaç a la categoria " src = " <?php echo get_template_directory_uri() . '/images/totslink.png';?> " /></ a >
< ? php endif ; ?>
2022-07-19 00:27:21 +02:00
2022-09-12 10:49:39 +02:00
</ div >
2022-07-19 00:27:21 +02:00
2022-09-06 12:34:14 +02:00
<!-- EQUIP i MATRONAT -->
2022-07-19 00:27:21 +02:00
< ? php elseif (( ! $category ) and ( $tipus == 'equip' )) :
$lang = qtrans_getLanguage ();
if ( $lang == 'ca' ) :
$carrec = get_post_meta ( $post -> ID , 'carrec' , true );
elseif ( $lang == 'es' ) :
$carrec = get_post_meta ( $post -> ID , 'carrecES' , true );
2021-02-18 14:09:56 +01:00
elseif ( $lang == 'en' ) :
$carrec = get_post_meta ( $post -> ID , 'carrecEN' , true );
endif ;
$email = get_post_meta ( $post -> ID , 'email' , true );
2022-07-19 00:27:21 +02:00
$telefon = get_post_meta ( $post -> ID , 'telefon' , true );
?>
< div class = " head-entry " > <!-- els equips només són índex , no tenen enllça a pàgina ni peu -->
< h3 class = " equip <?php echo $tipus ;?> " >< ? php the_title () ; ?> </h3>
< p class = " carrec " >< ? php echo $carrec ; //echo qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($carrec); ?> </p>
</ div >
< p class = " boxcurta " >< ? php echo $telefon ; ?> </p>
< p class = " meta box " >< ? php echo $email ; ?> </p>
< ? php if ( has_post_thumbnail () ) : ?>
< a href = " <?php the_permalink(); ?> " title = " <?php the_title_attribute(); ?> " >
< ? php the_post_thumbnail ( 'thumbnail' ); ?>
</ a >
< ? php else : ?>
< img class = " noimatge gran " width = " 200 " height = " 150 " title = " imatge no disponible " alt = " imatge no disponible " src = " <?php echo get_template_directory_uri() .'/images/noimatge.jpg';?> " />
< ? php endif ; ?>
< ? php if ( has_excerpt ()) : ?>
< p class = " excerptbox " >< ? php echo get_the_excerpt (); ?> </p>
< ? php else : ?>
< div class = " contingut curt " >< ? php echo custom_wp_trim_excerpt (); ?> </div>
< ? php endif ; ?>
<!-- els descarregables -->
< ? php elseif (( ! $category ) and ( $tipus == 'desc' )) : ?>
< div class = " head-entry " >
< ? php if ( is_home ()) : ?>
< span class = 'cat' >
< a href = " <?php echo get_permalink(136);?> " >< ? php echo get_the_title ( 136 ); ?> </a>
</ span >
< h2 class = " box <?php echo $tipus ;?> " >< a href = " <?php the_permalink(); ?> " title = " <?php printf( esc_attr__( 'Permalink to %s', 'hangar' ), the_title_attribute( 'echo=0' ) ); ?> " rel = " bookmark " >< ? php the_title () ; ?> </a> </h2>
< ? php else : ?>
< h3 class = " box <?php echo $tipus ;?> " >< a href = " <?php the_permalink(); ?> " title = " <?php printf( esc_attr__( 'Permalink to %s', 'hangar' ), the_title_attribute( 'echo=0' ) ); ?> " rel = " bookmark " >< ? php the_title () ; ?> </a> </h3>
< ? php endif ; ?>
</ div >
< div class = " contingut llarg " >
< ? php the_content (); ?>
</ div >
<!-- la fletxeta link al post / pàgina -->
< div class = " boxpeu " >
< a href = " <?php the_permalink(); ?> " class = " peubox " title = " <?php printf( esc_attr__( 'Permalink to %s', 'hangar' ), the_title_attribute( 'echo=0' ) ); ?> " rel = " bookmark " >< img alt = " enllaç " src = " <?php echo get_template_directory_uri() . '/images/fletxalink.png';?> " /></ a >
<!-- els quadrets link a la categoria pare -->
< ? php if ( is_home ()) : ?>
< a href = " <?php echo get_permalink(136); ?> " class = " peudret " title = " <?php echo get_the_title(136); ?> " rel = " bookmark " >< img alt = " enllaç a la categoria " src = " <?php echo get_template_directory_uri() . '/images/totslink.png';?> " /></ a > < ? php ?>
< ? php endif ; ?>
</ div >
<!-- resta de categories -->
< ? php else :
// echo " category " . $category . " catt2 " . $catt2 . " category 0 " . $category[0]->term_id;?>
< div class = " head-entry " >
< ? php if ( is_home ()) : ?>
< span class = " cat " >
< a href = " <?php echo get_category_link( $category[0] ->term_id );?> " >< ? php echo $category [ 0 ] -> name ; ?> </a>
</ span >
< h2 class = " box <?php echo $tipus ;?> " >< a href = " <?php the_permalink(); ?> " title = " <?php printf( esc_attr__( 'Permalink to %s', 'hangar' ), the_title_attribute( 'echo=0' ) ); ?> " rel = " bookmark " >< ? php echo the_title (); ?> </a> </h2>
< ? php else : ?>
< ? php if ( has_subcategories ( $catt2 )) : ?>
< span class = " cat " > <!-- atenció cal assingar cada post a la subcategoria , sinó sortirà la categoria pare -->
< a href = " <?php echo get_category_link( $category[0] ->term_id );?> " >< ? php echo $category [ 0 ] -> name ; ?> </a>
</ span >
< h3 class = " box <?php echo $tipus ;?> " >< a href = " <?php the_permalink(); ?> " title = " <?php printf( esc_attr__( 'Permalink to %s', 'hangar' ), the_title_attribute( 'echo=0' ) ); ?> " rel = " bookmark " >< ? php echo the_title (); ?> </a> </h3>
< ? php else : ?>
< ? php //echo get_permalink(); ?>
< h3 class = " box nosub<?php echo $tipus ;?> " >< a href = " <?php the_permalink(); ?> " title = " <?php printf( esc_attr__( 'Permalink to %s', 'hangar' ), the_title_attribute( 'echo=0' ) ); ?> " rel = " bookmark " >< ? php echo the_title (); ?> </a> </h3>
< ? php endif ; ?>
< ? php endif ; ?>
</ div >
< ? php
$lang = qtrans_getLanguage ();
2021-02-18 14:09:56 +01:00
if ( $lang == 'ca' and ( get_post_meta ( $post -> ID , 'data_activitat' , true ) )) :
2022-07-19 00:27:21 +02:00
?>
< p class = " meta box " >
< ? php
echo get_post_meta ( $post -> ID , 'data_activitat' , true );
if ( get_post_meta ( $post -> ID , 'horari_activitat' , true )) echo " / " . get_post_meta ( $post -> ID , 'horari_activitat' , true );
if ( get_post_meta ( $post -> ID , 'lloc_activitat' , true )) echo " - " . get_post_meta ( $post -> ID , 'lloc_activitat' , true );
?>
</ p >
< ? php
elseif ( $lang == 'es' and ( get_post_meta ( $post -> ID , 'data_activitatES' , true ) )) :
?>
< p class = " meta box " >
< ? php
echo get_post_meta ( $post -> ID , 'data_activitatES' , true );
if ( get_post_meta ( $post -> ID , 'horari_activitat' , true )) echo " / " . get_post_meta ( $post -> ID , 'horari_activitat' , true );
if ( get_post_meta ( $post -> ID , 'lloc_activitat' , true )) echo " - " . get_post_meta ( $post -> ID , 'lloc_activitat' , true );
?>
</ p >
< ? php
elseif ( $lang == 'en' and ( get_post_meta ( $post -> ID , 'data_activitatEN' , true ) )) :
?>
< p class = " meta box " >
< ? php
echo get_post_meta ( $post -> ID , 'data_activitatEN' , true );
if ( get_post_meta ( $post -> ID , 'horari_activitat' , true )) echo " / " . get_post_meta ( $post -> ID , 'horari_activitat' , true );
if ( get_post_meta ( $post -> ID , 'lloc_activitat' , true )) echo " - " . get_post_meta ( $post -> ID , 'lloc_activitat' , true );
?>
</ p >
< ? php else : ?>
< p class = " meta box novista " >< ? php // echo __('Publicat el ','hangar') . the_time('d F Y') ?></p>
< ? php endif ; ?>
< ? php if ( has_post_thumbnail () ) : ?>
< a href = " <?php the_permalink(); ?> " title = " <?php the_title_attribute(); ?> " >
< ? php the_post_thumbnail ( 'thumbnail' ); ?>
</ a >
< ? php endif ; ?>
< ? php
if ( has_excerpt ()) : ?>
< p class = " excerptbox " >
< ? php
// echo get_the_excerpt();
// https://developer.wordpress.org/reference/functions/wp_trim_words/
echo wp_trim_words ( get_the_excerpt (), 60 , ' <a href="' . get_permalink ( $post -> ID ) . '">[...]</a>' )
?>
</ p >
< ? php else : ?>
< div class = " contingut curt " >< ? php echo custom_wp_trim_excerpt (); ?> </div>
< ? php endif ; ?>
< div class = " boxpeu " >
< a href = " <?php the_permalink(); ?> " class = " peubox " title = " <?php printf( esc_attr__( 'Permalink to %s', 'hangar' ), the_title_attribute( 'echo=0' ) ); ?> " rel = " bookmark " >< img alt = " enllaç " src = " <?php echo get_template_directory_uri() . '/images/fletxalink.png';?> " /></ a >
< ? php if ( is_home ()) : ?>
<!-- els quadrets link a la categoria pare -->
< a href = " <?php echo get_category_link( $category[0] ->term_id ); ?> " class = " peudret " title = " <?php echo $category[0] ->name; ?> " rel = " bookmark " >< img alt = " enllaç a la categoria " src = " <?php echo get_template_directory_uri() . '/images/totslink.png';?> " /></ a >
< ? php endif ; ?>
</ div >
< ? php endif ; ?>
</ li ><!-- post . hentry -->