Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 96034

simonm223 on "Caption Shortcode appearing in category archive"

$
0
0

I've been using the following code to define my caption archive:

<section id="pageContent">
				<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
				<?php
					echo '<article>';
					echo '<span class="blue" style="font-size:20px; font-weight:bolder;"><a href="'.get_permalink().'" title="Read More">'.get_the_title().'</a></span><br />';

					echo str_replace("\r", "<br />", get_the_content(''));

					echo '<br /><a href="'.get_permalink().'" title="Read More">Read More &raquo;</a></p><hr />';
					echo '</article>';
				?>

It works perfectly except for one bug - articles with captions have shortcodes and image captions appended to them as follows:

[caption id="attachment_1877" align="alignleft" width="345"]CISAA soccer champion UCC's varsity soccer team is the 2013 CISAA champion.[/caption]

How do I strip the shortcode from the content?


Viewing all articles
Browse latest Browse all 96034

Trending Articles