The Image added by Add Media
is included in the Content.So I have splitted the image from the content.Below is the working code for my Question.
<?php $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches); ?>
<div class ="single-post-flex-slider">
<ul class="slides">
<?php for($i =0;$i<$output;$i++){ ?>
<li> <img src="https://wordpress.stackexchange.com/questions/174038/<?php echo $matches[1][$i]; ?>" width="500px" height="300px" /></li>
<?php } ?>
</ul>
</div>
Related Posts:
- Turn a URL into an Attachment / Post ID
- Delete Associated Media Upon Page Deletion
- Delete post with all files attached to it
- Is it possible to Schedule Attachments in WordPress?
- what types of order can I pass to get_posts() via orderby?
- Find the post an attachment is attached to
- media_handle_upload for local files?
- How do I detach images from posts?
- Use an attachment in multiple posts
- delete post also attachments
- Replacing all attachment links in post with media file link
- Get post id by attachment id?
- How can I export WordPress posts’ attachments?
- How to remove images from showing in a post with the_content()?
- How do I create Comma Separated list of attached image ids?
- Get post embedded image caption
- Limit amount of results returned
- post_parent is 0 when uploading new files
- Easy way to delete 70k posts and attached media?
- How to access featured image?
- Load post attached images on a single page site with fancybox
- Insert woocommerce products programmatically with featured image and gallery
- Add the description field on the attached media
- Set size for attachments
- I have a site where attachments in the wp_posts table have guid values of guid, how did this happen?
- Get all attachment by post excluding featured and content inside
- Prevent Delete Attachment by URL or When Submit
- Posts and Attachments with “Published” status in Search
- Get attachments for posts that belongs to a specific category
- Automatically attach image to post if they have the same title
- Get Image tag from content of post
- Can’t update old posts 3.5.2
- How would one change the default url structure of attachments?
- Get attachments only for this post
- Upload attachment from external site
- Reinstall WordPress while keeping attachments
- How To Download WordPress Audio Attachments
- How to get the next and previous image title from attachment or gallery?
- All images on one line for each post
- How do I assign an attachment to a post using only the REST API?
- Unable to delete attached file from folder programmatically
- How to convert attachment pages to Posts?
- Get post attachment with post id
- Delete attached images from posts
- Unable to get all the Posts Attachments
- Add in the url attachment loop the wp_link_pages of the post
- Stop images from being displayed on the front-end of the site
- How to get images only attached from edit post page
- How to prevent people from seeing an attachment to a scheduled post that’s released in future?
- How can I get a comment ID on Submit?
- Bulk Attach Or Insert Media To Post Without Opening Post Editor
- Post Attachment missing head (stylesheets/js/what-not)
- Create post from form with image
- Get Video Attachment to post
- how to edit attachments?
- Broken images after importing posts and opening in Gutenberg
- Random sort within an already sorted query
- Search by Hyphen
- Display the latest post from a category in a page
- rewind_posts() – what actually the use of it, and where using is required or preferred?
- Exclude posts with specific meta_value while sorting by a separate meta_value
- Problem ordering posts with numbers for titles numerically E.g. 1, 10, 100
- Post in Multiple Categories to stay in current category (permalink, next previous post link)
- Undefined variable post_id in custom quick edit coloumn
- Get attachment next and previous by author only
- Post preview and oembed provider issue using polylang plugin with subdomains
- How would I get 1 latest post from a query for 5 posts?
- Exclude posts with empty post_content in wp_query
- Exclude posts from featuring
- Diplay comment date on WP_Post_Comments_List_Table
- Enable post revisions for a specific post
- get_the_excerpt() is not working as expected – returns wrong text
- Category Page Template not Showing Posts
- Select only post id and meta value with WP_Query
- Recent posts and first featured
- Cannot retrieve a custom RSS field from posts
- Get the amount of posts on a current page
- Make insterted image point to post url instead of attachment page
- How to populate a select field with post titles/ids in a block
- How to add html code at the bottom of the post in archive page?
- WP_Query of Category Not Showing First Post
- content summary of a post disappears If an images added at the beginning of the post. how to solve it?
- How To Use Custom Fields With .mp3 Links
- how can display a post on home screen without images
- Save / Update meta data as multidimensional array
- Select another post in a post meta like a parent page is selected while editing a page
- How to Create another Page Category like the “Post” and “Pages”
- Manual Scheduler For Custom Post Type
- Category posts show on local install, they do not show on live server
- Only show related posts when another post has same term
- single- and archive- templates not being applied to custom post types, not even after flushing permalinks
- Alternating Post Styles on Homepage
- Posts per page, reverse count
- How to Test a Blog Post for Update vs. Publish Status — Unique
- Inserting image into post content – Front End
- Commenting on a post from the admin panel?
- How to filter categories of a post
- Ajax calls in wordpress
- Adding a content rating system
- unable to select “fullwidth” on the POST (not page)