Compare commits

..

2 Commits

4 changed files with 242 additions and 353 deletions

View File

@ -1,180 +1,209 @@
<li id="post-<?php the_ID(); ?>" <?php echo 'class ="boxentry ' . $tipus; if (in_category("destacado")) echo ' destacat'; echo '"'; ?>> <li id="post-<?php the_ID(); ?>" <?php echo 'class ="boxentry ' . $tipus; if (in_category("destacado")) echo ' destacat'; echo '"'; ?>>
<!-- <?php echo $category; ?> --> <?php //echo $category; ?>
<!-- <?php echo $tipus; ?> --> <?php //echo $tipus; ?>
<!-- les pàgines fixes (no categories ni artistes) --> <!-- les pàgines fixes (no categories ni artistes) -->
<?php if ((!$category) and ($tipus == 'pag')) : ?> <?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> <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 ?> <?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"> <div class="contingut plus">
<?php echo $contingut; ?> <?php echo $contingut; ?>
</div> </div>
<div class="boxpeu" > <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> <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> </div>
<!-- els artistes --> <!-- els artistes -->
<?php elseif ((!$category) and (($tipus == 'art')) or ($tipus == 'obra')): ?> <?php elseif ((!$category) and (($tipus == 'art')) or ($tipus == 'obra')): ?>
<div class="head-entry"> <div class="head-entry">
<?php if (is_home()) : ?> <?php if (is_home()) : ?>
<span class='cat'> <span class='cat'>
<a href="<?php echo get_permalink(2);?>"><?php echo get_the_title(2);?></a> <a href="<?php echo get_permalink(2);?>"><?php echo get_the_title(2);?></a>
</span> </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> <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 : ?> <?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> <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;?> <?php endif;?>
</div> </div>
<?php if ($tipus == 'art') : <?php if ($tipus == 'art') :
if(get_post_meta($post->ID, 'autor_tipo_resid', true) && get_post_meta($post->ID, 'autor_data_resid', true)): ?> if(get_post_meta($post->ID, 'autor_tipo_resid', true) && get_post_meta($post->ID, 'autor_data_resid', true)): ?>
<p class="meta box"> <p class="meta box">
<?php echo __(get_post_meta($post->ID, 'autor_tipo_resid', true)) ?> <?php echo __(get_post_meta($post->ID, 'autor_tipo_resid', true)) ?>
<br /> <br />
<?php echo __(get_post_meta($post->ID, 'autor_data_resid', true)) ?> <?php echo __(get_post_meta($post->ID, 'autor_data_resid', true)) ?>
</p> </p>
<?php else : ?> <?php else : ?>
<p class="meta box novista"></p> <p class="meta box novista"></p>
<?php endif; ?> <?php endif; ?>
<?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 : ?> <?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';?>" /> <p class="meta box"><?php echo get_post_meta($post->ID, 'data_obra', true) ?></p>
<?php endif; ?> <?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" > <div class="boxpeu" >
<!-- la fletxeta link al post/pàgina --> <!-- 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> <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()) : ?> <?php if (is_home()) : ?>
<!-- els quadrets link a la categoria pare --> <!-- 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> <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; ?> <?php endif; ?>
</div> </div>
<!-- EQUIP --> <!-- EQUIP -->
<?php elseif ((!$category) and ($tipus == 'equip')): <?php elseif ((!$category) and ($tipus == 'equip')):
$lang = qtrans_getLanguage(); $lang = qtrans_getLanguage();
if($lang == 'ca'): if($lang == 'ca'):
$carrec = get_post_meta($post->ID, 'carrec', true); $carrec = get_post_meta($post->ID, 'carrec', true);
elseif($lang == 'es'): elseif($lang == 'es'):
$carrec = get_post_meta($post->ID, 'carrecES', true); $carrec = get_post_meta($post->ID, 'carrecES', true);
elseif($lang == 'en'): elseif($lang == 'en'):
$carrec = get_post_meta($post->ID, 'carrecEN', true); $carrec = get_post_meta($post->ID, 'carrecEN', true);
endif; endif;
$email = get_post_meta($post->ID, 'email', true); $email = get_post_meta($post->ID, 'email', true);
$telefon = get_post_meta($post->ID, 'telefon', 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--> <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> <h3 class="equip <?php echo $tipus;?>"><?php the_title() ;?> </h3>
<p class="carrec"><?php echo $carrec; //echo qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($carrec); ?> </p> <p class="carrec"><?php echo $carrec; //echo qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($carrec); ?> </p>
</div> </div>
<p class="boxcurta"><?php echo $telefon; ?> </p> <p class="boxcurta"><?php echo $telefon; ?> </p>
<p class="meta box"><?php echo $email; ?> </p> <p class="meta box"><?php echo $email; ?> </p>
<?php if ( has_post_thumbnail() ) : ?> <?php if ( has_post_thumbnail() ) : ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" > <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
<?php the_post_thumbnail('thumbnail'); ?> <?php the_post_thumbnail('thumbnail'); ?>
</a> </a>
<?php else : ?> <?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';?>" /> <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 endif; ?>
<?php if (has_excerpt()) : ?> <?php if (has_excerpt()) : ?>
<p class="excerptbox"><?php echo get_the_excerpt(); ?></p> <p class="excerptbox"><?php echo get_the_excerpt(); ?></p>
<?php else :?> <?php else :?>
<div class="contingut curt"><?php echo custom_wp_trim_excerpt(); ?></div> <div class="contingut curt"><?php echo custom_wp_trim_excerpt(); ?></div>
<?php endif; ?> <?php endif; ?>
<!-- els descarregables --> <!-- els descarregables -->
<?php elseif ((!$category) and ($tipus == 'desc')): ?> <?php elseif ((!$category) and ($tipus == 'desc')): ?>
<div class="head-entry"> <div class="head-entry">
<?php if (is_home()) : ?> <?php if (is_home()) : ?>
<span class='cat'> <span class='cat'>
<a href="<?php echo get_permalink(136);?>"><?php echo get_the_title(136);?></a> <a href="<?php echo get_permalink(136);?>"><?php echo get_the_title(136);?></a>
</span> </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> <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 : ?> <?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> <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;?> <?php endif;?>
</div> </div>
<div class="contingut llarg"> <div class="contingut llarg">
<?php the_content(); ?> <?php the_content(); ?>
</div> </div>
<!-- la fletxeta link al post/pàgina --> <!-- la fletxeta link al post/pàgina -->
<div class="boxpeu"> <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> <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 --> <!-- els quadrets link a la categoria pare -->
<?php if (is_home()) : ?> <?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 ?> <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; ?> <?php endif; ?>
</div> </div>
<!-- resta de categories --> <!-- resta de categories -->
<?php else : <?php else :
// echo " category " . $category . " catt2 " . $catt2 . " category 0 " . $category[0]->term_id;?> // echo " category " . $category . " catt2 " . $catt2 . " category 0 " . $category[0]->term_id;?>
<div class="head-entry"> <div class="head-entry">
<?php if (is_home()) : ?> <?php if (is_home()) : ?>
<span class='cat'> <span class="cat">
<a href="<?php echo get_category_link( $category[0]->term_id );?>"><?php echo $category[0]->name;?></a> <a href="<?php echo get_category_link( $category[0]->term_id );?>"><?php echo $category[0]->name;?></a>
</span> </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> <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 else : ?>
<?php if (has_subcategories($catt2)) : ?> <?php if (has_subcategories($catt2)) : ?>
<span class='cat'> <!-- atenció cal assingar cada post a la subcategoria, sinó sortirà la categoria pare --> <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> <a href="<?php echo get_category_link( $category[0]->term_id );?>"><?php echo $category[0]->name;?></a>
</span> </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> <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 else : ?>
<!-- <?php echo get_permalink(); ?> --> <?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> <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;?>
<?php endif; ?> <?php endif; ?>
</div> </div>
<?php $lang = qtrans_getLanguage(); <?php
$lang = qtrans_getLanguage();
if($lang == 'ca' and (get_post_meta($post->ID, 'data_activitat', true) )): if($lang == 'ca' and (get_post_meta($post->ID, 'data_activitat', true) )):
?><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">
?><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 <?php
elseif($lang == 'en' and (get_post_meta($post->ID, 'data_activitatEN', true) )): echo get_post_meta($post->ID, 'data_activitat', 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 if (get_post_meta($post->ID, 'horari_activitat', true)) echo " / ".get_post_meta($post->ID, 'horari_activitat', true);
else: ?> if (get_post_meta($post->ID, 'lloc_activitat', true)) echo " - ".get_post_meta($post->ID, 'lloc_activitat', true);
<p class="meta box novista"><?php // echo __('Publicat el ','hangar') . the_time('d F Y') ?></p> ?>
<?php endif;?> </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() ) : ?> <?php if ( has_post_thumbnail() ) : ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" > <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
<?php the_post_thumbnail('thumbnail'); ?> <?php the_post_thumbnail('thumbnail'); ?>
</a> </a>
<?php else : ?> <?php endif; ?>
<!--<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 custom_wp_trim_excerpt(); ?></div>
<?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" > <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> <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()) : ?> <?php if (is_home()) : ?>
<!-- els quadrets link a la categoria pare --> <!-- 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> <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;?> <?php endif;?>
</div> </div>
<?php endif; ?> <?php endif; ?>
</li><!-- post .hentry --> </li><!-- post .hentry -->

View File

@ -1,13 +1,13 @@
<?php <?php
/** /**
* Template Name: Category ample * Template Name: Category ample
* *
* Seccions de categories amd presentaçio de contingut ample. * Seccions de categories amd presentaçio de contingut ample.
* @link http://themehybrid.com/themes/hybrid/page-templates/categories * @link http://themehybrid.com/themes/hybrid/page-templates/categories
* *
* @package Hangar * @package Hangar
* @subpackage Template * @subpackage Template
*/ */
get_header(); ?> get_header(); ?>
@ -19,43 +19,45 @@ get_header(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class("boxentry"); ?>> <div id="post-<?php the_ID(); ?>" <?php post_class("boxentry"); ?>>
<div class="entry-content"> <div class="entry-content">
<?php echo '<h2 class="box index">'; <?php echo '<h2 class="box index">';
echo single_cat_title( '', false ) ; echo '</h2>' ; ?> echo single_cat_title( '', false ) ; echo '</h2>' ; ?>
<?php $category_description = category_description(); <?php $category_description = category_description();
if ( ! empty( $category_description ) ) : if ( ! empty( $category_description ) ) :
echo '<div class="descseccio">'. category_description(). '</div>'; echo '<div class="descseccio">'. category_description(). '</div>';
endif; endif;
?> ?>
</div><!-- .entry-content --> </div><!-- .entry-content -->
</div><!-- post .boxentry --> </div><!-- post .boxentry -->
</div><!-- .indexall.wide --> </div><!-- .indexall.wide -->
<?php $catt2 = get_query_var('cat'); ?>
<?php $catt2 = get_query_var('cat'); ?>
<div id="content" class="indexall fills"> <div id="content" class="indexall fills">
<ul> <ul>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php $tipus = 'catt'; <?php
$category = get_the_category(); $tipus = 'catt';
?> $category = get_the_category();
?>
<?php include(TEMPLATEPATH . "/caixes.php"); ?> <?php include(TEMPLATEPATH . "/caixes.php"); ?>
<?php endwhile; ?> <?php endwhile; ?>
</ul> </ul>
<?php wp_pagenavi(); /* kriesi_pagination();*/?> </div><!-- .indexall.fills -->
<?php wp_pagenavi(); /* kriesi_pagination();*/?>
<?php else: ?>
<?php else: ?> <p class="no-data">
<?php _e( 'Apologies, but no results were found.', 'hangar' ); ?>
</p><!-- .no-data -->
</div><!-- .indexall.fills -->
<p class="no-data"> <?php endif; ?>
<?php _e( 'Apologies, but no results were found.', 'hangar' ); ?>
</p><!-- .no-data -->
<?php endif; ?>
</div><!-- .indexall.fills -->
</div><!--end #main--> </div><!--end #main-->

View File

@ -129,10 +129,11 @@
.toogle-sidebar-segona .hide-not-mobile{ .toogle-sidebar-segona .hide-not-mobile{
display:none; display:none;
} }
.indexall {
display: flex;
}
.indexall.wide{ .indexall.wide{
width: 100%; width: 100%;
display: flex;
margin-right: 35px; margin-right: 35px;
} }
.indexall.wide .boxentry h2.index { .indexall.wide .boxentry h2.index {

View File

@ -28,123 +28,29 @@ require_once(THEMELIB . '/breadcrumb.php');
// Create custom posts and custom fields // Create custom posts and custom fields
require_once(THEMELIB . '/custom-posts.php'); require_once(THEMELIB . '/custom-posts.php');
function new_excerpt_length($length) { function hangar_excerpt_length($length) {
return 20; return 20;
} }
add_filter('excerpt_length', 'new_excerpt_length'); add_filter('excerpt_length', 'hangar_excerpt_length');
function new_excerpt_more($more) { function hangar_excerpt_more($more) {
global $post; global $post;
return '<a href="'. get_permalink($post->ID) . '"> [...]</a>'; return '<a href="'. get_permalink($post->ID) . '"> [...]</a>';
} }
add_filter('excerpt_more', 'new_excerpt_more'); add_filter('excerpt_more', 'hangar_excerpt_more');
// custom login screen i peu de l'admin // custom login screen i peu de l'admin
function custom_login() { function custom_login() {
//echo '<link rel="stylesheet" type="text/css" href="'.get_bloginfo('template_directory').'/custom-login/custom-login.css" />';
// time stamp for caching
// https://developer.wordpress.org/reference/functions/wp_enqueue_style/#comment-2056
echo '<link rel="stylesheet" type="text/css" href="'. get_template_directory_uri() .'/custom-login/custom-login.css" />'; echo '<link rel="stylesheet" type="text/css" href="'. get_template_directory_uri() .'/custom-login/custom-login.css" />';
} }
add_action('login_head', 'custom_login'); add_action('login_head', 'custom_login');
//function change_wp_login_url() {
//echo bloginfo('url');
//}
//add_filter('login_headerurl', 'change_wp_login_url');
//function change_wp_login_title() {
//echo 'Powered by ' . get_option('blogname');
//}
//add_filter('login_headertitle', 'change_wp_login_title');
function remove_footer_admin () { function remove_footer_admin () {
echo 'Custom text | Copyright &copy; message'; echo 'Custom text | Copyright &copy; message';
} }
add_filter('admin_footer_text', 'remove_footer_admin'); add_filter('admin_footer_text', 'remove_footer_admin');
// THIS GIVES US SOME OPTIONS FOR STYLING THE ADMIN AREA
function custom_controls() {
// echo '<style type="text/css">
// label.lateral{width: 100px;}
// input.lateral{width: 150px; border-color: #ddd;}
// .petit {width: 20px!important;}
// label.dd{float:left; width:250px;}
// input.dd{width:450px;}
// </style>';
}
add_action('admin_head', 'custom_controls');
/* create calendar event when saving post with dates */
// function create_event( $post_id ) {
//
// // If this is just a revision, don't send the email.
// if ( wp_is_post_revision( $post_id ) )
// return;
//
// $myPost = get_post($post_id);
// if (has_category(array('news', 'activitats-dels-residents'), $post_id) &&
// !$update &&
// $myPost->post_modified_gmt == $myPost->post_date_gmt) {
//
// //The URL that we want to send a PUT request to.
// $uid = get_the_guid( $post_id );
// $url = 'https://cloud.hangar.org/remote.php/dav/calendars/hangar/hangar_activitats/neu.ics';
// $headers = array('Content-Type: text/calendar', 'charset=utf-8');
// $userpwd = 'hangar:AV63xlklCuOJgYTnHz5smX4chiAaDpJo';
// $description = get_the_content( $post_id );
// $summary = get_the_title( $post_id );
// $tstart = gmdate("Ymd\THis\Z", strtotime("-2 days"));
// $tend = gmdate("Ymd\THis\Z", strtotime("-2 days"));
// $tstamp = gmdate("Ymd\THis\Z");
//
// // vcalendar
// $body = 'BEGIN:VCALENDAR
// VERSION:2.0
// BEGIN:VEVENT
// DTSTAMP:$tstamp
// DTSTART:$tstart
// DTEND:$tend
// UID:$uid
// DESCRIPTION:$description
// LOCATION:Hangar
// SUMMARY:$summary
// END:VEVENT
// END:VCALENDAR';
//
// //Initiate cURL
// $ch = curl_init($url);
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
// curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
// curl_setopt($ch, CURLOPT_USERPWD, $userpwd);
// //curl_setopt($ch, CURLOPT_PUT, true);
// curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
// curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
//
// //Execute the request.
// $response = curl_exec($ch);
// curl_close($ch);
//
// // send confirmation mail
// $post_title = $summary;
// $post_excerpt = $description;
// $post_url = get_permalink( $post_id );
// $subject = 'A new EVENT post has been saved';
//
// $message = "A new post has been created on your website:\n\n";
// $message .= $post_title . ": " . $post_url . "\n\n";
// $message .= $post_excerpt . "\n\n";
// $message .= $uid . "\n\n";
// $message .= print_r($response);
//
// // Send email to admin.
// wp_mail( 'gerald@hangar.org', $subject, $message );
// }
// }
// add_action( 'save_post', 'create_event', 10, 3 );
//per imprimir el content sense que ens tregui l'html //per imprimir el content sense que ens tregui l'html
function get_the_content_with_formatting ($more_link_text = '(...)', $stripteaser = 0, $more_file = '') { function get_the_content_with_formatting ($more_link_text = '(...)', $stripteaser = 0, $more_file = '') {
@ -154,24 +60,6 @@ function get_the_content_with_formatting ($more_link_text = '(...)', $striptease
$content = substr($content, 0,400); $content = substr($content, 0,400);
return $content; return $content;
} }
//per imprimir l'excerpt indicant un nombre de caràcters màxim
// function the_excerpt_max_charlength($charlength) {
// $excerpt = get_the_excerpt();
// $charlength++;
// if(strlen($excerpt)>$charlength) {
// $subex = substr($excerpt,0,$charlength-5);
// $exwords = explode(" ",$subex);
// $excut = -(strlen($exwords[count($exwords)-1]));
// if($excut<0) {
// echo substr($subex,0,$excut);
// } else {
// echo $subex;
// }
// echo "[...]";
// } else {
// echo $excerpt;
// }
// }
//afegir estils a l'editor //afegir estils a l'editor
@ -248,7 +136,7 @@ function has_subcategories($catt)
endif; endif;
} }
//contruim un panell de control a l'administració per a que vegin les que estan marcades per a sortir a la home //construim un panell de control a l'administració per a que vegin les que estan marcades per a sortir a la home
function menu_control_home(){ function menu_control_home(){
add_menu_page( "Control Home","Control Home", "add_users", "control_home", "control_home", "", 6 ); add_menu_page( "Control Home","Control Home", "add_users", "control_home", "control_home", "", 6 );
} }
@ -374,37 +262,6 @@ class my_Walker_Nav_Menu extends Walker_Nav_Menu {
<?php <?php
/* Code that preserves HTML formating to the automatically generated Excerpt. */ /* Code that preserves HTML formating to the automatically generated Excerpt. */
/* Also modifies the default excerpt_length and excerpt_more filters. */ /* Also modifies the default excerpt_length and excerpt_more filters. */
/*function custom_wp_trim_excerpt($text) {
$raw_excerpt = $text;
if ( '' == $text ) {
$text = get_the_content('');
$text = strip_shortcodes( $text );
$text = apply_filters('the_content', $text);
$text = str_replace(']]>', ']]&gt;', $text);
//Add the allowed HTML tags separated by a comma.
$allowed_tags = '<p>,<a>,<em>,<strong>';
$text = strip_tags($text, $allowed_tags);
//Change the excerpt word count.
$excerpt_word_count = 60;
$excerpt_length = apply_filters('excerpt_length', $excerpt_word_count);
//Change the excerpt ending.
$excerpt_end = ' <a href="'. get_permalink($post->ID) . '">' . '&raquo; Continue Reading.' . '</a>';
$excerpt_more = apply_filters('excerpt_more', ' ' . $excerpt_end);
$words = preg_split("/[\n\r\t ]+/", $text, $excerpt_length + 1, PREG_SPLIT_NO_EMPTY);
if ( count($words) > $excerpt_length ) {
array_pop($words);
$text = implode(' ', $words);
$text = $text . $excerpt_more;
} else {
$text = implode(' ', $words);
}
}*/
// https://stackoverflow.com/questions/15283948/wordpress-html-tags-strip-on-manual-excerpt // https://stackoverflow.com/questions/15283948/wordpress-html-tags-strip-on-manual-excerpt
function custom_wp_trim_excerpt($text='') { function custom_wp_trim_excerpt($text='') {
@ -429,7 +286,7 @@ if ( '' == $text ) {
$excerpt_word_count = 200; /*** MODIFY THIS. change the excerpt word count to any integer you like.***/ $excerpt_word_count = 200; /*** MODIFY THIS. change the excerpt word count to any integer you like.***/
$excerpt_length = apply_filters('excerpt_length', $excerpt_word_count); $excerpt_length = apply_filters('excerpt_length', $excerpt_word_count);
$excerpt_end = '[...]'; /*** MODIFY THIS. change the excerpt endind to something else.***/ $excerpt_end = '<a href="'. get_permalink($post->ID) . '"> [...]</a>'; /*** MODIFY THIS. change the excerpt endind to something else.***/
$excerpt_more = apply_filters('excerpt_more', ' ' . $excerpt_end); $excerpt_more = apply_filters('excerpt_more', ' ' . $excerpt_end);
$words = preg_split("/[\n\r\t ]+/", $text, $excerpt_length + 1, PREG_SPLIT_NO_EMPTY); $words = preg_split("/[\n\r\t ]+/", $text, $excerpt_length + 1, PREG_SPLIT_NO_EMPTY);