cleaned up the_excerpt and short content. tagged properly the header sections

This commit is contained in:
jorge 2022-09-23 19:25:58 +02:00
parent a63aa3d923
commit c0dab68f92
2 changed files with 11 additions and 10 deletions

View File

@ -2,14 +2,17 @@
<!-- les pàgines fixes (no categories ni artistes) -->
<?php if ((!$category) and ($tipus == 'pag')) : ?>
<article class="not-category 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>
<div class="head-entry">
<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>
</div>
<div class="contingut plus">
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
<?php the_post_thumbnail('thumbnail'); ?>
</a>
<?php the_excerpt(); ?>
<?php //the_excerpt(); ?>
<?php echo hangar_trim_excerpt(); ?>
</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>
@ -47,7 +50,6 @@
<div class="contingut">
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
<?php the_post_thumbnail('artists-thumb'); ?>
<?php //the_post_thumbnail('thumbnail'); ?>
</a>
</div>
<?php else : ?>
@ -57,11 +59,11 @@
<?php endif; ?>
<div class="boxpeu" >
<!-- la fletxeta link al post/pàgina -->
<?php // 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 -->
<?php // 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>
@ -93,7 +95,7 @@
<?php endif; ?>
<?php if (has_excerpt()) : ?>
<p class="excerptbox"><?php the_excerpt();//echo get_the_excerpt(); ?></p>
<p class="excerptbox"><?php the_excerpt();?></p>
<?php else :?>
<div class="contingut curt"><?php echo hangar_trim_excerpt(); ?></div>
<?php endif; ?>
@ -201,7 +203,6 @@
<div class="contingut">
<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>')
?>

View File

@ -23,7 +23,7 @@ get_header(); ?>
<h2 class="box index"><?php the_title(); ?></h2>
<?php if ( has_post_thumbnail() ) : // check if the post has a Post Thumbnail assigned to it.
the_post_thumbnail('thumbnail'); ?>
<p class="excerptbox"><?php echo get_the_excerpt(); ?></p>
<p class="excerptbox"><?php the_excerpt(); ?></p>
<?php else : ?>
<div class="contentcurt">
<?php the_content(); ?>