Im trying to filter out all of the tags inside a post in wordpress using strip_tags(). I set it up like this:
<?php
// The Query
echo date ("Y");
query_posts( 'p=10' );
// The Loop
while ( have_posts() ) : the_post();
$footertext = the_content();
echo strip_tags($footertext);
endwhile;
// Reset Query
?>
This doesn't seem to strip out the tags they way I expected.
Change the_content()
to get_the_content()
.
the_content()
is used to directly output the contents whereas get_the_content
returns contents to be stored in variable for further processing.
$footertext = get_the_content();