I finally found a solution that works. In case you need it, here it is:
<?php
if (has_post_format('quote', $post->ID)) {
$content = trim(get_the_content());
// Take the first quote from the content
$quote_string = extract_from_string('<blockquote>', '</blockquote>', $content);
// Make sure there's a quote on the content
if (!$quote_string == "") {
// Get the first quote and show it on the Loop
echo $quote_string;
} else {
// If not, show nothing
}
}
?>
Related Posts:
- has_post_format() vs. get_post_format()
- What difference does it make if I enable support for video post format?
- How do I remove the post format meta box?
- Adding post-formats to Twenty Ten child theme
- Is there a real life use case for post formats except for microbloging?
- Renaming post formats after Gutenberg
- What is the recommended behavior for the post formats?
- Custom Post Formats
- Target all posts that are NOT aside or link post formats
- Displaying all Video Post Formats to Page
- Display Post Format as a String
- Different markup for each post format
- How to recognise on which site the content is being rendered?
- post formats – how to get the relevant content part?
- Post formats for Pages not saving
- Is there any problem if I use get_template_part like this?
- How can I remove the first video from a post and feature it?
- previous_post_link/next_post_link disappear when excluding by post_format
- Usage of post_formats
- how to get list of post formats supported by theme?
- Formatting Standard Post Format
- If post-format == ‘gallery’ conditional
- Adding new post format on plugin activation
- post formats – where’s the difference: “aside” vs. “status”?
- How to get the id or url of the image in an image post?
- About post format
- Smart post format loop problems
- “post-format” code snippets list [closed]
- wordpress post formats
- How to display quote format by preg_match function?
- I would like to have a quote page just to show quotes
- How to display list of video post on video section?
- Paste from word not preserving formatting
- How to treat post formats?
- Post formats and template hierarchy
- Change standard post format metabox
- Next Post Link in format
- Mass post format changer?
- Displaying cf post formats with oembed
- Custom formatting
- How do I query by post format in WordPress 3.1
- static variable loop not working in WordPress
- Custom Post Formats for Custom Post Types
- Different post format options per custom post type?
- How to query posts of standard post format. For real
- Changing “Enter title here” based on post format
- How to exclude posts of a certain format from the feed
- Plugin to set all Posts in a certain Category to a certain Post Format
- Post formats template
- Update caption for metabox gallery images
- How to show post format gallery metabox image caption in the post front end
- How to get post attachments in gallery post format template
- Change post format using custom field
- How to enqueue scripts depending on post formats?
- Removing the post format (type) slug
- Add URL field to the link post format
- How does WP detect format type (and can I make use of this)?
- How to generate a featured image from a video embeded in a metabox
- Strip shortcode from specific post types (formats)
- Hide meta box based on post format
- Apply post formats to a specific post type only?
- Tumblr-like Post Types for WordPress
- How to query for posts without a post_format
- Filtering post-formats from the loop using new WP-Query();
- WordPress export tool doesn’t export post-format value of custom post type?
- Registering different Post Formats for Blog Post and CPT
- Filtering out specific post formats from certain pages
- Exclude certain post formats from pagination
- trigger html cleanup for all posts
- How to add Post Format Taxonomy Archive page in the menu?
- Hide Gallery from the_conent
- Next Posts Prev Posts for Standard post format only
- What’s the best practice way of handling custom fields in different post formats?
- Displaying icon image for WordPress post formats, is there a cleaner way to do this?
- How can I add a filter to a particular post format?
- Override post-formats in child theme
- How do I get standard posts to open up in their own template when using get_template_part()?
- Almost Done… Post Format Code
- Can I assign a Folder for Post Formats, without it affecting WordPress’ fallback/hierarchical system?
- Post format or Type for List Type Posts
- Audio post format with Advanced Custom Fields
- How to modify get_the_excerpt() when post-format equals ‘quote’?
- Getting Twitter Content on My Blog
- Post archive for certain post format
- Add specific custom fields to post formats
- Video post format, extra content breaks video embed
- How can I convert everything from category X to have post format Link
- Display archives based in post_format
- Return only one post format in index.php [duplicate]
- Setting ‘post_format’
- Post Format problem
- CPT unsaved draft gives error 404 – when Post Formats support enabled
- An archive page without post format (just standard post)
- How can I add WordPress Audio Player as featured audio in Audio Blog Posts?
- Rewrite a specific Post Format to URL slug
- Filter image and text from post format
- Specific Post Format Image Thumbnail
- Remove Title, Editor and Meta Box Support Based on Post Formats
- Cafe Food Menu upload
- How to reproduce the post format field in a front end form?