2 improved code formatting
source | link

I am new in WordPress plugin development. I am developing a simple WordPress plugin in which get_the_excerpt()get_the_excerpt() not working in the loop. Other tags such as get_the_title()get_the_title(), get_the_permalink()get_the_permalink() even get_the_content()get_the_content() working fine. Please somebody help me out on this. Here is the code

if($loop->have_posts()) : 
while($loop->have_posts()) : 
      $loop->the_post(); 
   $content .= '<li><a href="'.get_permalink().'">'.get_the_title().'</a><br />'.get_the_excerpt().'</li>';
endwhile; wp_reset_postdata(); endif; 

I am new in WordPress plugin development. I am developing a simple WordPress plugin in which get_the_excerpt() not working in the loop. Other tags such as get_the_title(), get_the_permalink() even get_the_content() working fine. Please somebody help me out on this. Here is the code

if($loop->have_posts()) : 
while($loop->have_posts()) : 
      $loop->the_post(); 
   $content .= '<li><a href="'.get_permalink().'">'.get_the_title().'</a><br />'.get_the_excerpt().'</li>';
endwhile; wp_reset_postdata(); endif; 

I am new in WordPress plugin development. I am developing a simple WordPress plugin in which get_the_excerpt() not working in the loop. Other tags such as get_the_title(), get_the_permalink() even get_the_content() working fine. Please somebody help me out on this. Here is the code

if($loop->have_posts()) : 
while($loop->have_posts()) : 
      $loop->the_post(); 
   $content .= '<li><a href="'.get_permalink().'">'.get_the_title().'</a><br />'.get_the_excerpt().'</li>';
endwhile; wp_reset_postdata(); endif; 
1
source | link

get_the_excerpt() not working in plugin loop

I am new in WordPress plugin development. I am developing a simple WordPress plugin in which get_the_excerpt() not working in the loop. Other tags such as get_the_title(), get_the_permalink() even get_the_content() working fine. Please somebody help me out on this. Here is the code

if($loop->have_posts()) : 
while($loop->have_posts()) : 
      $loop->the_post(); 
   $content .= '<li><a href="'.get_permalink().'">'.get_the_title().'</a><br />'.get_the_excerpt().'</li>';
endwhile; wp_reset_postdata(); endif;