Exclude the pdf button text from the excerpt function
-
Exclude the pdf button text from the excerpt function:
$post_type = ‘post’;
// Get all the taxonomies for this post type
$taxonomies = get_object_taxonomies( array( ‘post_type’ => $post_type ) );foreach( $taxonomies as $taxonomy ) :
// Gets every “category” (term) in this taxonomy to get the respective posts
$terms = get_terms( $taxonomy );foreach( $terms as $term ) : ?>
<h2 class=”entry-title” ><?php echo $term->name; ?></h2>
<?php
$args = array(‘post_type’ => $post_type,
‘posts_per_page’ => -1, //show all posts
‘tax_query’ => array(
array(
‘taxonomy’ => $taxonomy,
‘field’ => ‘slug’,
‘terms’ => $term->slug,
‘cat’ => ‘-3’
)
));
$posts = new WP_Query($args);if( $posts->have_posts() ): while( $posts->have_posts() ) : $posts->the_post(); ?>
<article id=”prodotti”>
<?php if(has_post_thumbnail()) { ?>
” title=”<?php echo get_the_title(); ?>”>
<?php the_post_thumbnail(‘archive-custom-size’, array( ‘class’ => ‘aligncenter’ )); ?>
<?php }
/* no post image so show default */
else { ?>
/assets/img/default-img.png” alt=”<?php echo get_the_title(); ?>” title=”<?php echo get_the_title(); ?>” width=”110″ height=”110″ />
<?php } ?><h3 >” title=”<?php echo get_the_title(); ?>”><?php echo get_the_title(); ?></h3>
<?php the_excerpt(); ?>
</article><!– about-box –>
<?php endwhile; endif; ?>
<?php endforeach;
endforeach; ?>
- The topic ‘Exclude the pdf button text from the excerpt function’ is closed to new replies.