Try this:
query_posts(array(
'p' => $topright,
'post_type' => array('post', 'page'),
));
Related Posts:
- query_post by title?
- Why query_posts() isn’t marked as deprecated?
- Help to condense/optimize some working code
- How do I create a random post that will last for a day
- Modify main WordPress loop with a parse_query filter
- How to make “sticky” pages (and query by them)
- Problem with ‘post__not_in’
- Having trouble generating pagination links on custom query
- Use union/intersection query_posts variables in uri request parameter form?
- query_posts doesn’t order by title
- query_posts and pagination, still stuck after much research
- Query posts by taxonomy term name
- Sorting problem with ‘query_posts’ funcion in wordpress. Sort by custom field not working
- How to sort by meta value?
- pagination in author.php template returns 404 error
- query recent posts from several categories
- Show Posts From Same Category OR Same Tag
- Example Query Posts Showing the Latest Post with the Featured Image
- How do i paginate query_posts with numeric pagination?
- How to order results by date and meta key?
- Different number of posts on the front page
- Query posts without a specific ID
- posts_per_page => 1 shows 2 posts
- Show individual author rank from query of cumulative post view count for all authors
- Custom posts per page does not work with pagination
- Static Front-Page Excerpts
- posts_per_page override by default settings
- How to paginate posts correctly that belong to a particular category and are random ordered
- Tricky WP Query
- tax_query operator woes
- How can i display the posts per week in a particular month?
- How to filter query to display posts from parent category only?
- Display random post on a page with post permalink in URL
- Possible to display posts containing a short code ?
- How to run a SQL Query for character in Post Titles
- WordPress pagination with get_posts?
- Authors List page : how to exclude posts from certain category
- Using ajax with paging and a custom sub-query
- query_posts() on key’s value, or key’s existence
- ACF Query meta_values don’t work with ‘offset’
- How to display certain category in the loop from WordPress default post type?
- How to retrieve an array of post IDs by a particular value stored in a custom meta’s array
- define orderby URL with meta_key=post_views_count
- Query_posts and attachments
- Custom loops, sticky posts, and pagination nightmare
- Querying posts only if the current page is not paged?
- how to store wordpress loop in array?
- Filter Loop by Custom Field Value
- meta_query check for meta value in key which holds an array of values
- Display custom post type by custom taxonomy
- WordPress wp_get_attachment_thumb_url full
- Exclude posts by post meta value
- Single-page wordpress theme navigation
- meta tag placement for google verification
- How to change default post type / post to media or attachments
- How to Show Comment Count on Related Posts?
- Frontend form with multiple posts
- Query Products & Store IDs in array
- Way to cache a query for 24 hrs
- query_posts orderby multiple ways
- Make query_post category name dynamic
- How can I list posts with different formats depending on order?
- query_posts orderby postmeta [closed]
- Can I use WP_Query one time and then filter the results multiple times
- Pagination linking to first page
- Posts being viewed
- View Achive with Category Filter, but Page per post not working
- Meta query stopped working
- Sticky posts don’t show up first in custom loop
- Want Page Descendants when using query_posts post_parent or child_of
- show all in query_posts on category.php?
- Query Posts Incorrectly Displaying Tags Archives
- Querying a query
- Best Query for blog posts
- Most Effective Method? Exclude Category and Number of Posts Per Page
- How do I query based on the modified date?
- Custom query looking at multiple custom fields and properly sorting
- post var problem with shortcode loop
- Pre-existing arguments when using queries
- Get posts for each user
- How to put orderby on a custom field in query_posts
- Pull new posts using feed
- Filter posts by current date ( WP Post Carousel )
- query_posts() with multiple meta data comparisons
- query_posts not working after wordpress 3.7 update
- Post Filter clearing on pagination $_post
- get_next_posts_link() stops displaying at page 4
- Multiple post queries -category,posts per page,orderby
- Is that the query_posts() the real criminal here?
- How to can I search range of products using between
- Query specific posts from parent by slug rather ID
- query_posts and sub pages?
- How to refine WP-Query with further criteria
- Query Posts (post meta)
- Multiple loops with / without sticky posts and different post limits
- get all posts with certain meta data
- prevent display duplicate titles on main page
- Lots of SQL queries
- How do I find the first item in the post array?
- Limiting the amount of posts this displays