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?
- Get content from one page and show it on another page
- Removing any and all inline styles from the_content()
- How to disable content pagination?
- Getting the Next and Previous Posts Titles in the Sidebar?
- Adding a div class or id inside the_content()
- Post X of Y in single.php / sidebar.php
- 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 to add custom content (text/image) at start of content (IN content ie the same line)
- 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
- 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
- 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?
- WordPress Sidebar menu for posts based on date – guidance needed
- 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
- 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
- Sidebar limiting to 10 posts?
- WordPress Excerpt Paragraph Limiting
- 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 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?
- Moved a website and excerpts don’t work for old posts
- Enable HTML Tags in WordPress Post excerpt
- How to display post excerpt beside post list inside Post of Dashboard
- if CPT content is empty then
- Posts on Sidebar only
- Find post tags words in post content and link them to tag URLs
- Trim excerpt to first paragraph
- Nothing appears using get_the_excerpt() in category.php
- Add review box by function at top or bottom of content
- Post List Widget with custom posts and editing the Read More Link
- Showing content from WordPress ruins page CSS using WP_Query, without, content does not show
- Correcting the content width when sidebar is inactive?
- Show category post with excerpt text
- Same sidebar in all posts as in the category
- Add a minimum word count to Excerpt (and how to force Excerpt as a rule for WyPiekacz)
- How can i show only 30% of the “the_content(“More…”)”?
- How do I display the next 3 posts in the sidebar?
- Assign custom class to post content images
- Stripping tag from elements in post
- How to show only the date, the title and a little “summary” of my WordPress post in my custom theme?
- excerpt in template for specific page
- Excerpt all post content Content Same Size without word cutting off
- Show full post only to loged-in users
- Read more opens attachment
- my website didn’t show the defult right sidebars