WordPress.org

Ready to get started?Download WordPress

Forums

content not including br tags for my custom page/theme (1 post)

  1. gswartz
    Member
    Posted 1 year ago #

    We have a customer who wanted a custom site where all the different pages content gets loaded on the home page and we use a slider to slide each page's content into view when the nav link is clicked. We're running into times when line breaks in the page content is not being translated to the br tags wordpress usually provides. Sometimes wp is including them but most of the time is not. Here's the code I have for displaying the content. Is there some other way that I need to call this so wp provides br tags for any line breaks? Thanks.

    <?php
    $ids = array(8,10,15,114,19);
    foreach ($ids as $id){
    ?>
                 <li class="postcontentwrapper"><?php $page_data = get_page($id);
    				echo "<div class='postheader'>".$page_data->post_title."</div>";
    				echo "<div class='postcontent'>".$page_data->post_content."</div>";
    			?></li>    
    
    <?php
    	}
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic