If you’re video embeds are always the same, I like the solution proposed by 5wpthemes, but if you want to avoid having to use a custom field ( and more specifically, remembering to do it), you could also try the code below ( which also requires the code to be very similar in every post ).
<?php $my_query = new WP query(array('cat'=>6, 'showposts'=> '2')); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
$theContent = get_the_content();
$parts = explode("iframe",$theContent);
?><iframe<? echo $parts[1]; ?>iframe><?php
<?php endwhile; ?>
Related Posts:
- Modify ‘Read more’ link adding a new class
- How to show post(excerpt) from specific category on wp page?
- How to disable the_excerpt from one post
- How to limit wordpress the_excerpt() dynamically
- Stop WordPress Wrapping Images In A “P” Tag
- GET the excerpt by ID
- How to get ‘post_content’ without stripping tags?
- How to end the excerpt with a sentence rather than a word?
- Get content from one page and show it on another page
- Removing any and all inline styles from the_content()
- Display Random Author with Details in Sidebar
- How to disable content pagination?
- Getting the Next and Previous Posts Titles in the Sidebar?
- Adding a div class or id inside the_content()
- Remove image caption from post excerpt
- Post X of Y in single.php / sidebar.php
- Divide Post content into separate divs for every 500 characters (or any other character counts)
- Post content being duplicated by the_content();
- How to add an admin function only to posts, not pages?
- How to customize read more link
- Custom wp_trim_words() function not trimming right
- Display all posts under child sub category in sidebar on post page?
- How can I extract the URL of a link from a post?
- Content editor creating blank paragraphs in spaces and creating   in the_excerpt
- How to add custom content (text/image) at start of content (IN content ie the same line)
- Load posts into sidebar and paginate via ajax?
- Testing for post title in ‘if/else’ statement returns no content
- How to link up “read more” on excerpts hack from WP Recipies
- Append Text to $post->post_excerpt
- Frontend Post Excerpt field mapping
- Allowing the SoundCloud player to appear in a post excerpt
- Auto Refresh Post List after X seconds
- Display the Content of a Post with qTip2
- How to show a full post, not just an excerpt
- WordPress menu that shows all posts in a certain category like w3schools
- custom post type grid with content in lightbox [closed]
- How can I hide the sidebar from a specific post?
- Get post excerpt and title by specific post ID?
- Custom excerpt length filter doesn’t work
- Display most recent post in full, excerpts of older posts
- Modify WP_Post before processing
- Sidebar links for different pages
- Uppercase first sentence in every post
- Show all posts in sidebar in single.php
- Why content_arr[‘extended’] removes paragraph tags?
- Get latest posts from WordPress site without header, menu and sidebar
- Modify Image Source With The_Content Filter?
- How to add pagination in between post and comments?
- Post-ID in url differs from $post->ID
- Print a message if excerpt is empty after posts have been publish/update!
- Adding the_date inside tags around the_content
- get_the_excerpt() is not working as expected – returns wrong text
- Show the content that is after the excerpt using child theme
- Can wordpress post and sidebar remain visible after scroll?
- How do I display some posts fully on the homepage, and some as an excerpt only?
- get query() without post content?
- WordPress Sidebar menu for posts based on date – guidance needed
- How to show full post?
- How to display excerpt post on hamepage and archive pages?
- Filter only the text in the_content
- How to check if single.php has already called the_post_thumbnail function
- 2 dynamic sidebars registered, not showing up
- Sidebar show posts by current category also in single post
- Displaying post excerpt using wpdb query
- The_excerpt() doesn’t parse – how to change that?
- Trying to edit archive.php to only show post extract, with featured image
- Show metabox value last post excerpt, title and link
- Hook for changing excerpt content when excerpt not set
- Change the number of excerpts displayed in search results layout
- the_excerpt is displaying excerpts of every post
- Add div before the first paragraph the_content [closed]
- the_content() Not Grabbing All Content
- Why excerpt is Displaying same in Random Posts list
- Display a post via template
- Adding a meta box to determine the sidebar [closed]
- content summary of a post disappears If an images added at the beginning of the post. how to solve it?
- Sidebar on single.php not showing up
- Widget to show posts in the sidebar basing on its IDs
- Sidebar limiting to 10 posts?
- WordPress Excerpt Paragraph Limiting
- Getting post and attached image from subdomain
- Conditionally exclude post from specific category on home page sidebar?
- Adding if statement into the_content()
- Grab value of excerpt_length
- Show 10 latest posts only from users with contributors role
- Calling Permalinks With PHP
- Display most recent posts in category with Twenty Ten theme widget
- why my urdu text is not aligned properly when written in wordpress blog post?
- How do I display main query posts in random order using add_filter
- How to Remove HTML Elements from Post Excerpt?
- How to exclude native lazy loading from first image in post content?
- How to add text before post_excerpt in Gutenberg
- Why is WordPress showing a blank excerpt for just one of my posts?
- How can I create a ‘sub-blog’ which has its own sidebar on individual posts?
- Related post not showing table of content
- how can i take wordpress post as embed?
- Moved a website and excerpts don’t work for old posts
- Enable HTML Tags in WordPress Post excerpt
- Single Sidebar; multiple templates! How?
- How to display post excerpt beside post list inside Post of Dashboard