Support

Account

Home Forums Front-end Issues Textarea loses the breaks < br > when pulled as Post Item

Helping

Textarea loses the breaks < br > when pulled as Post Item

  • I have a textarea and line breaks are replaced by <br> on the content-post_type.php as intended. Now I’m trying to pull the posts’ content to a different page – which basically works fine. But when I’m pulling the textarea’s content from inside a repeater field (‘releases’) , the breaks are ignored.

    // loop through the rows of data
      while ( have_rows('releases') ) : the_row();
    	
        // get sub field values					
        $post_object = get_sub_field('release');
    			
    	if( $post_object ): 
    			
    	$post = $post_object;
    			
    	setup_postdata( $post ); 
    
    	$alt_name = get_field('alt_name');
    
    	echo $alt_name; // no line breaks show up
    
    	wp_reset_postdata();
    
    	endif;
    	
    endwhile;

    Am I missing something…?

    Thank you very much!

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.