Wpautop stops working after get_the_excerpt
-
<div <?php post_class('post');?> id="post-<?php the_ID();?>"> <div class="date" title="<?php the_time('g:i a'); ?>"> <span class="month"><?php the_time('F'); ?></span> <span class="day"><?php the_time('d'); ?></span> <span class="year"><?php the_time('Y'); ?></span> </div> <div class="text"> <h4><a href="<?php the_permalink();?>"><?php the_title();?></a></h4> <?php if($post_type=='post'):?> <div class="meta"> <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" title="<?php printf(__('Posted by %s','wi') , get_the_author() ); ?>" rel="author" class="author"><?php the_author(); ?></a> <span class="slash">/</span> <?php comments_popup_link( __('Leave a comment','wi'), __('1 comment','wi'), __('% comment','wi'), 'comment-link', __('Comments are closed','wi') ); ?> </div> <?php else: // post type == 'portfolio'?> <div class="categories"> <?php echo get_the_term_list( get_the_ID(), 'category', '', '<span class="slash">/</span>', '' );?> </div> <?php endif; // endif post_type ?> <div class="excerpt"> <p><?php echo substr(get_the_excerpt(),0,80);?> …</p> <div><a href="<?php the_permalink();?>" class="readmore"><?php _e('Read more →','wi');?></a></div> </div> </div> <div class="clearfix"></div> </div>
Above is a loop I’ve used for my shortcode. The problem is: when i add the line get_the_excerpt inside the code block, wpautop stops working after that. After removing get_the_excerpt, everything is back to normal.
Anyone knows how to solve this problem?
- The topic ‘Wpautop stops working after get_the_excerpt’ is closed to new replies.