Buongiorno a tutti,
ho una questione che non riesco a risolvere e che riguarda una funzione relativa alla lunghezza degli excerpt. Gli excerpt in questione sono quelli degli articoli correlati presenti in ogni post.
Se all'interno di un articolo visualizzo 2 o più articoli correlati, ma volessi aumentare la lunghezza dei caratteri del loro riassunto, come dovrei procedere per non modificare il file functions.php ?
Premetto che ho creato un tema child e ho già il file functions.php per il child, che funzione dovrei aggiungere?
Questo è il codice presente nel functions.php del tema genitore:
codice:
$my_query = new wp_query( $relatedpost );?>
<div id="related-posts" class="row-fluid">
<?php if( $my_query->have_posts() ) { ?>
<h3>Articoli correlati</h3>
<ul>
<?php while( $my_query->have_posts() ) { $my_query->the_post();
if ($smof_data['awp_related_post_style']=="Title + Image + Description") { ?>
<li>
<div class="thumbx70 alignleft"><?php
if ( has_post_thumbnail() ) {
/*echo get_the_post_thumbnail($post->ID, 'thumbnail'); */
the_post_thumbnail('thumbnail');
}
else { global $smof_data?>
<img class="attachment-thumbnail "src="<?php echo $smof_data['awp_thumbnail_image'] ?>" alt="">
<?php } ?>
</div>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<br>
<?php echo substr(get_the_excerpt(), 0,310); ?>...
<div class="clearfix"></div>
</li>
<?php } elseif ($smof_data['awp_related_post_style']=="Title Only") { ?>
<li>
<i class="icon-ok-circle"></i> <a class="pophover" href="<?php the_permalink()?>" title="<?php the_title(); ?>" data-content="<?php echo substr(get_the_excerpt(), 0,310); ?>..."><?php the_title(); ?></a>
</li>
Grazie