• Resolved ruipdguerra

    (@ruipdguerra)


    <?php
    	for ($ii=0; $ii<$published_posts; $ii++) {
    		$listposts = get_posts( array( 'numberposts' => -1, 'category' => 4, 'exclude' => 164 ) );
    		$list_content = array();
    		foreach( $listposts as $post ) {
    			$list_content[] = $post->post_content;
    		}
    ?>
    		<!-- post content div -->
    		<div class="post_content" id="<?php echo $ii; ?>">
    			<?php
    				echo $list_content[$ii] . "<br>";
    			?>
    		</div>
    
    	<?php
    	}
    	?>

    How can i print html from post_content?

Viewing 1 replies (of 1 total)
  • Thread Starter ruipdguerra

    (@ruipdguerra)

    Found it.
    Just need to change the echo for this:

    echo apply_filters('the_content', $list_content[$ii]);

Viewing 1 replies (of 1 total)
  • The topic ‘output post_content with HTML’ is closed to new replies.