I have a WordPress page named Services where the content is custom HTML (added in the Text tab in TinyMCE). I'm trying to use WP_Query
on the splash page to pull the Services content and display it inside a DIV
. What I'm getting however is plain text. It looks like WP_Query
is parsing the HTML and then displaying what is left. The URL is not public, but here is my PHP recommended by the theme tech support (ElegantThemes/Vertex) ...
<section class="home-block et-odd">
<div class="container">
<?php $the_query = new WP_Query( 'page_id=4' ); ?>
<?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
<?php the_excerpt(); ?>
<?php endwhile;?>
</div> <!-- .container -->
</section>
the_content()
instead ofthe_excerpt()
?the_content()
worked beautifully. The tut I was looking at only talked about how to usethe_excerpt()
and not the other options. I also found info explaining thatWP_Query
is an 'object' etc. Thanks!