I have a WordPress site and I want to remove the block quotes from the post and put just the regular text. (also want to remove any images that are in the text, I just want the regular text)
This code does the OPPOSITE of what I want – takes out the block quotes and posts that. I want it to post the other text and NOT the block quote.
<?php
// get the content
$block = get_the_content();
// check and retrieve blockquote
if(preg_match('~<blockquote>([sS]+?)</blockquote>~', $block, $matches))
// output blockquote
echo $matches[1];
?>
What you need is a content filter. Add the following to your functions.php file
Try this
Just add this to your code:
The way wali hassan sayed is to add following code to your function.php:
This overrides the default “the_content()” function so in you page template you only need to call: