add in standard WordPress post specific template tags here eg.
the_title(), the_permalink, the_content, the_excerpt etc.
endforeach;
Like that comments says, call the function you need to display the title.
The category argument appears to represent the category ID, not the slug. Try using category_name
instead.
[php]
$myposts = new WP_Query('posts_per_page=5&category_name=basics');
while($myposts->have_posts()):
$myposts->the_post();
// your output
the_title();
endwhile;
wp_reset_query();
[/php]
Related Posts:
- How to change the case of all post titles to “Title Case”
- Dynamically add id to heading tags
- Confirmation box when submitting post for review
- Ajax Load More Posts in Category Page
- Publish pending article from front end with a button?
- List latest posts in WP-Admin
- Update all posts automatically when using post_meta
- Restrict users from editing post based on the age of the post
- Change slug with custom field
- Restrict access to post if it is currently being edited
- Getting an alphabetic post list with two letters onclick on letter
- Create new category upon save based on post information
- which action to hook to in order to perform post-publish action
- Strange switch_to_blog() issue
- POST from jQuery to PHP
- Search widget breaks when using multiple loops?
- $post object is null
- Advanced Custom Fields – Storing array value for further usage
- Function to show random posts from a category
- str_replace the_title(); blues
- Accessing post->ID outside of the loop for listing child pages
- how to set beforsend option in wordpress ajax methods
- Display post category in foreach loop with category link
- WordPress Custom Fields (Checkboxes with multiple values)
- Why WP_Query(‘showposts=5’) shows only 1 post?
- Most liked page not displaying posts
- How to make number of blog posts a custom field?
- Creating a post from data returned from HTML form
- List authors with the last post title and order by last post date
- Display post category in foreach loop
- Page template is accessing the incorrect posts?
- Can’t get full post title if there a spaces in title
- Get post meta retrieving wrong value
- Adding a user’s ID behind the tag ref link address
- How can I remove the first two words and shorten get_the_title()
- How to show 3 most recent/viewed posts in a special tiles on home page using wordpress?
- Dark Bar at the top of wordpress page can’t be seen?
- How to add PHP code snippet to all Post pages?
- How to display only one category in a custom post type?
- Display message depending on capability outside loop
- Limiting the amount of posts retrieved by the loop
- Hide content from Post Preview
- How to get the next and previous image title from attachment or gallery?
- displaying the categories post
- Adjust the order for returned posts
- How To Use Custom Fields With .mp3 Links
- Defining ‘last’ class on foreach blog posts
- Categories Listing and Highlighting current category item
- A better code for no post format?
- Help Combine These Two PHP Codes
- How to limit the number of results for all query_posts on mysite
- Show a Category Specific Info Box
- How to get all the terms of a post
- Get first comment link on the post itself
- User driven content problems
- How can i retrive the movies, trailers, news in a single page using search
- How can I create a menu items from meta box based on users input
- Older entries link within a category page
- How do I display a full post, not just an excerpt?
- Remove read more
- Insert new post for each user infinite loop error
- List direct children of page
- wordpress radio button on single post page
- How *not* to show the last post on the latest posts list
- Create post from form with image
- Exclude a ‘portfolio’ custom category?
- Display a custom field rating system in the front end
- get value from post to sidebar
- Echo author slug in post edit page
- Adding a content rating system
- Determine if page is the Posts Page
- How to get ‘post_content’ without stripping tags?
- display all posts in wordpress admin
- When and Where is `global $post` Set and Available?
- How to Sort Custom columns in admin
- Shortcode Not displayed at the Right Place [duplicate]
- How to change post status from publish to draft using hook in wordpress?
- How to show video from specific category on sidebar?
- Display posts with comments closed, with pagination?
- How can I add a meta-box to the posts editor containing all items of a custom taxonomy as checkbox?
- can’t use the page_test method to check pagination
- How to set a min number of words for a blog post
- Multi row post list
- How do I insert a post with custom post type and relate it to a custom taxonomy?
- Add field to user meta table in database when link is clicked
- Custom Fields for Author Box
- Get the id of all images in a post
- Custom home page with full post for first one only
- Need to know custom code to display random and most viewed posts in wordpress posts and pages
- Load widget only on blog posts
- Widget to show posts in the sidebar basing on its IDs
- Page of posts made to look like homepage
- Related post not showing table of content
- Posts missing on author page
- Added a ACF field to custom page and want the results to show as a column in admin
- How to prevent clicking on posts
- WordPress post filter
- One of my posts is displayed as page
- What is wrong with this wp_query?
- Edit Page button is gone