$args = array(
'posts_per_page'=>-1,
'number_posts'=>-1,
'category'=>9,
'orderby'=>'post_date',
'order' => 'DESC',
'post_type'=>'post',
'post_status'=>'publish'
);
$posts = get_posts($args);
foreach($posts as $post):
$id= $post->ID;
$permalink = get_permalink( $id );
$title = $post->post_title;
$content = $post->post_content;
$image = wp_get_attachment_url(get_post_thumbnail_id($id));
endforeach;
Related Posts:
- Custom text box containing post titles
- Display recent posts with thumbnail within Masonry
- How do I use wp_get_recent_posts?
- Add Date to Recent Posts Widget?
- Recent Posts widget has some older posts at the top? [closed]
- how to show post content with post name in sidebar?
- Adding a badge to new blog post titles
- How to make slider show 4 recent news and news start from begining not from 4th
- Display recent post by tag
- Small intro before latest blog posts
- WordPress Recent post only showing title
- Recent post on single page from specyfic category
- Help with “Recent Posts” Loop that is specific to a topic
- Get Each user recent post in wordpress
- How to display last 3 posts (recent posts) in a static page?
- Querying post from a multisite network
- Display all comments or recent comments per user on author page
- Add inline HTML to posts published within last 24hrs
- Modifying recent post widget to include icons for post titles
- Add thumbnail to recent posts widget using filters
- How to exclude categories from recent posts, recent comments & category widgets?
- meta_query not working properly
- Unable to show recent custom post types in default recent posts widget
- Related Posts loop – offset
- Show one post per author and limit query to 8 posts
- How to target the default Recent Posts and Recent Comments widgets with pre_get_posts?
- Empty excerpt using wp_get_recent_posts
- Display Custom Post Type in Recent Posts
- Show recent published posts
- How to hide a post from ‘Recent Posts’ widget?
- customizing recent posts
- Display the date before the post title in recent posts widget
- How to display recent posts added in several custom post types
- Order posts by meta value and Date
- How can I show recent posts from same taxonomy as the post currently being viewed?
- Grabbing specific content
- How to get most recent commented post above new submitted post in WordPress?
- Two posts are loaded instead of one?
- Change recent posts widget title
- How to start with post number x?
- Use wp_get_recent_posts with search term
- Create static front-page with 3-5 recent posts
- Display most recent post on homepage?
- Customizing wordpress default widgets?
- recent posts for different categories
- How do I exclude recent post from recent post php widget
- menu item to display the most recent post
- Single-post preview repeats thumbnails in Jupiter Recent Posts widget
- Custom recent-posts shortcode’s thumbnail image not in line with rest of code
- How to get date of post when using wp_get_recent_posts()?
- How to get excerpt of the recent posts
- List most recently added posts (with a twist)
- link to single most recent post, regardless of category
- How to obtain the recent posts without their content in an efficient way?
- ‘Recent Posts’ links open in new window, without copying the ‘WP_Widget_Recent_Posts’ class
- Posts modified in the last 48 hours
- Show recent posts starting at a specific number archive
- How do I get the content excerpt of the recent post?
- How to Link to Most Recent Custom Post of Same Term
- widget_posts_args not using the number of posts in widget
- Display css ONLY on most recent post of specific category?
- Sort / display recent posts by publish date
- Add hero image to home page (blog format) via the dashboard
- List recent posts with link to first category
- Why aren’t paragraphs breaking on this page?
- Problem with Front-Page.php loading recent posts
- Showing recent post of category in page
- Where to add offset?
- Manual excerpt length on recent posts slider
- Homepage custom recent news
- How to add a recent post function to a text widget I created for practice?
- showing all recent posts in theme
- How do I add a small excerpt of a blog post on my Front Page Recent Posts widget?
- Import Recent Posts Only and Ignore old ones if exist
- add title to widgets of wordpress
- Cannot manage to display my CPT in Recent Posts widget
- Editing HTML structure of Gutenberg layout recent post?
- Display Most Recent Post Widget Title On Page
- Showing wordpress latest post thumbnails in slider with auto increment
- date_query problem
- How to add thumbnails from recent posts to owl-carousel in wordpress automatically?
- Recent Posts Widget URL / Domain change
- Recent post in the middle of the content
- Recent posts show thumbnail
- Paginate recent posts widget
- Show all posts of all categories but excluding a category on custom blog page with pagination of my theme
- Have latest post and recent posts display differently
- Show recent posts in single-post page
- Duplicate content with the same URL, google authorship
- shortcode for recent custom type post
- Building Menus with the latest posts included
- Query recent posts by author
- Adjust layout most recent post, taking pagination into account
- Author Link in Recent Posts Widget
- Lists Top Authors by Most Recent Posts
- How to display recent posts on home page with title, post date, author and featured image?
- How to filter content by language with WPGlobus
- Recent posts with different class name for each post and a scrollbar?
- Recent posts with comment count in “Sidebar” template [closed]
- How can I show second most recent post in sidebar, if most recent post is open in the browser?