Targeting and posting block quotes from posts

Ge data from a particular html tag like p, section, in get_the_content() using php.
// get the content
$content = get_the_content();
// check and retrieve blockquote
if(preg_match('~<blockquote>([\s\S]+?)</blockquote>~', $content, $matches))
    // output blockquote
    echo $matches[1];

Recent Article

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Keep your skills sharp, get informed.

    Subscribe to our mailing list and get interesting stuff and updates to your email inbox