try to use get_posts instead , as I read in http://codex.wordpress.org/Function_Reference/query_posts
you can use this code:
global $post;
$args = array('posts_per_page' =>3,'category' => 3 );
$myposts = get_posts( $args );
foreach( $myposts as $post ) :
setup_postdata($post);
the_title()
endforeach;
wp_reset_postdata();
Regard’s.
Related Posts:
- Build a content and excerpt grid loop with paging and options for # of posts
- Alter query on edit.php
- How to order posts by modified date without using ‘query_posts’?
- Getting movie and serial on actor page
- Two posts in same div – WP loop
- how to display active, upcoming and past event with featured listing with pagination
- Include a specific post to the query_posts and remove it if it is already in the returned list
- Insert all post IDs in new database table
- Exclude posts from homepage having a specified tag
- Working with query_posts ( arrays and query strings)
- Can’t search posts using WP_QUERY inside AJAX Function
- Displaying the last post on static homepage
- Using loop pagination on single.php
- Logged in user ID as post ID
- Sort query_posts for Parent Pages to menue order or the count?
- WP_Query adds “(wp_posts.ID = ‘0’)” so no results are returned
- Sort by page information by Ascending Numbers
- How to list posts from a plugin taxonomy?
- Counting Search results, and displaying the offset per page
- How to get post ID in a Page?
- Pagination broken on is_front_page()
- change the default order of posts only for specific categories
- Posts are not looping through correctly
- limit number of post for achive page
- Saving a post ID to use in a form elsewhere on website
- posts_nav_link pulling in multiple post types
- Remove Post if Advanced Custom Field is checked to fix paging
- How to break up php code to avoid echo
- Limit the number of child pages
- search.php to search only the post title
- Hot to check if new posts have been published since page load and notify online users?
- WordPress create custom XML RSS feed template
- WordPress sorting posts by date and title using a dropdown
- Is there anyway I can call the year once?
- How to only fetch certain Tag ID’s
- Div Missing In Custom Loop Query
- Create a hierarchical loop at predefined markup requirements
- How to exclude post from being queried based on custom meta value
- Automatically create a loop for post ID
- Query specific posts per user selections from dropdown menus
- Dropdown Menu for Query_Posts
- Custom query_posts() parameter
- Does wp_query and query_posts affect website performance? [duplicate]
- Pagination in category.php not functioning
- How to modify this function to exclude also the post belonging to a specific category?
- /page/2/ redirect to 404
- How do I exclude the current post from the upcoming post query
- Exclude first post from wp query
- Category Attachment Pagination 404 Error on 2nd Page
- Sidebar not appearing in footer, but it appears everywhere else!
- How to create table in wordpress without plugin? [closed]
- Use Tags to initiate Search
- How can i show post_class() within output loop?
- Search form does not work in my website
- Show About and Contact Us page when they’re clicked in the top menu.
- How to remove ?p= from wordpress short links
- How to Disable WordPress Page Revisions?
- Display custom field on 404 page outside loop
- single.php with different look by category
- How i can get post data from database when i am getting post id from url in wordpress
- WordPress Block developer from exporting Database via PHP
- How to retrieve the data from the sever and displaying it in a page?
- I’m trying to create an array with a foreach loop, but the array only stores the last item [closed]
- Hook called before text widget save
- Is There A Way To Make Theme Files Accept Shortcodes?
- WordPress Ajax Always returning 0
- Is there any way to get a drop down list of time zones?
- src script only works on home page?
- php within html within php
- Conditional statement for dates
- Filtering a function’ output for a new continued function
- get_total () returns 0 – woocommerce [closed]
- Why does this update_post_meta function not delete the custom field itself?
- How to create an ACF shortcode with Repeater Field in WordPress? [duplicate]
- How does WordPress interpret the php code?
- get_template_part() not firing within a switch statement when template has new WP_Query
- add onchange to select in a wp form
- WordPress Customizer Default Image
- How to list commenters and days since last commented
- How to show/hide php table rows based on the content of custom fields
- How can I include shortcodes within PHP?
- How to execute html code inside php?
- PHP Warning: strip_tags() expects parameter 1 to be string?
- Run str_replace on title and save the output to a custom field
- Which function crops images in wordpress?
- Using a $GET parameter from a URL, to redirect to a URL (WordPress)
- How to determine from a different folder (outside wordpress) if a visitor is logged into WordPress
- WordPress function and string as variable?
- Delete taxonomy and delete all post related it
- Is a series of update_option calls safe, performance wise?
- plugin add action hook is not working :
- How to call multiple functions from multiple files into a WordPress page template [closed]
- Theme’s Options Page included with require_once *.php in functions.php not visible anymore
- wp-options keep crashing please help
- wp_insert_post: array only. wp_update_post: array|object (?)
- what do I replace get_bloginfo with and where do I find all instances of it?
- Remove dash from blog title wordpress
- Using data sent via AJAX in multiple functions on a WP plugin
- Querying Database with wpdb
- What is the difference in the WP memory limits?