hangar-wp-theme/caixes4.php

164 lines
10 KiB
PHP

<li id="post-<?php the_ID(); ?>" <?php echo 'class ="boxentry ' . $tipus . '"'; ?>>
<!-- 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>
<?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>
<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/fletxalinkblanca.png';?>" /></a>
</div>
<!-- els artistes -->
<?php elseif ((!$category) and (($tipus == 'art')) or ($tipus == 'obra')): ?>
<div class="head-entry">
<?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;?>
</div>
<?php if ($tipus == 'art') : ?>
<p class="meta box"><?php echo get_post_meta($post->ID, 'autor_data_resid', true) ?></p>
<?php else : ?>
<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'); ?>
</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';?>" />
<?php endif; ?>
<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>
<?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; ?>
</div>
<!-- EQUIP -->
<?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);
elseif($lang == 'en'):
$carrec = get_post_meta($post->ID, 'carrecEN', true);
endif;
$email = get_post_meta($post->ID, 'email', true);
$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 get_the_content_with_formatting(); ?></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 : ?>
<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 : ?>
<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 if (get_post_meta($post->ID, 'data_activitat', true) ) : ?></p>
<p class="meta box"><?php echo get_post_meta($post->ID, 'data_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 else : ?>
<img class="noimatge" 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 get_the_content_with_formatting(); ?></div>
<!-- <p class="excerptbox"><?php echo wp_trim_excerpt(); ?></p>-->
<?php endif; ?>
<!--
<div class="contentllarg"><?php echo get_the_content_with_formatting(); ?></div>-->
<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 -->