Figured it out myself, for anyone else that needs help here are the two options..
<!--Method 1-->
<?php $query = new WP_Query(); $query->query('post_type=page&p=' . of_get_option('slide_page1'));while ($query->have_posts()) : $query->the_post(); ?>
<?php the_title(); ?>
<?php endwhile; wp_reset_query(); ?>
<!--Method 2-->
<?php $slide1 = of_get_option('slide_page1');?>
<?php $loop = new WP_Query( array('p' => $slide1, 'post_type' => array('post', 'page'), )); ?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<h3> <?php the_title(); ?></h3>
<?php endwhile; wp_reset_query(); ?>
Related Posts:
- When should you use WP_Query vs query_posts() vs get_posts()?
- Wp get all the sub pages of the parent using wp query
- How to query for most viewed posts and show top 5
- WP_Query vs get_posts
- Query Custom Meta Value with Increment
- Get posts by meta data OR title
- Perform query with meta_value date
- WP_Query ordered by custom field that is a date string?
- Pass the same object to multiple widgets in a template with one query
- Retrieve or Query Pages by ID
- How do you query wordpress posts using a math formula between multiple meta field values?
- How to implement time filter to show random post 1 month for one category and 3 months for other categories
- Page navigation doesn’t show when query category
- How to query a custom post type with a taxonomy filter but display post type archive page?
- Change query_posts to WP_Query in page but does not work
- Custom Query num_rows returns wrong amount
- Slow page loads due to WordPress Core Query
- How can I override one post and make it display content for another post?
- Include current post into loop
- Filter post query to only show direct children of category
- Should I reset $wp_query?
- Why doesn’t my WP Meta Query return any results?
- Filter products on category AND tag
- pre_user_query vs pre_get_posts
- Get posts that match defined arrays of tags
- I need query_posts() to order results first by a meta value and then by post ID
- How to show post title in content editor in backend?
- My entry results are not consistently alphabetized
- Merge two queries and remove duplicate
- Ordering Posts by parent category, name ascending
- Optimising specific Query with ACF meta objects
- How to organize a WP_Query’s list of posts by category and display category title?
- When should you use WP_Query vs query_posts() vs get_posts()?
- How to query post ids liked by the Author
- WordPress Query showing multiple titles
- Query Posts by date range with fixed beginning and end
- custom query to get posts
- Using OR conditions in meta_query for query_posts argument
- What is the most efficient way of querying posts based on visits and date for current day?
- Get posts by menu ID
- Get the number of posts from the current page results
- When should you use wp_reset_postdata vs wp_reset_query?
- Meta Query with date and time on the same Day before given time
- Order posts by tags count?
- Add and in the header while looping over custom query in page template
- Which custom query am I in and how can I access its properties & methods?
- Multiple search queries on one page
- How to speed up wp_query, took more 5s to run against 100k posts
- How To Get Some Data From WordPress Database Using WordPress $wpdb Query?
- Create ONE callback for all page templates, post filter queries + paginated pages, triggering pagination via AJAX
- Exclude posts with empty post_content in wp_query
- Custom category search box for WordPress
- Minimize database queries to user tables?
- Query with a meta value inside a given range
- Query all published post AND attachment with specific mime type
- Get all products which have both product category
- unable to retrive parent page information
- How to display multiple custom fields with the same meta_key in an ascending order?
- How to display user order by role
- WP Query related posts by tags
- Order by summing multiple values
- Check if loop has any categories?
- How to display an other custom post type in a different custom post type’s archive?
- How to increase load time of an archive/search page (WP_Query)
- Easy way to write complex queries in wordpress
- get_posts output always same post
- Query_posts works when appending via AJAX call wp_query doesn’t?
- How to make posts unqueryable/unpublish posts where ACF relationship field is an unpublished post? [closed]
- Yoast primary category query modification
- Write WP Query that selects posts that are part of the same two categories
- Get next/prev image/attachment in time with date query
- Include one page/post into query which is already returning posts
- Trouble Making WP_Query paged
- Disable (or limit) queries when certain content (or data) is not needed (or showed)
- Prioritising and Ordering Posts By Category Name Using A Custom Loop
- Optimising WP_Query with ACF Fields
- Query pages created by deleted users
- How do I stop the same post showing multiple times in a archive?
- Doing $wpdb->get_results returns NULL, doing the same query in my DB returns correct value
- How to get meta key list efficiently?
- Why pagination is not working with tax_query param?
- trying to change from query_post to WP_Query
- Strange results from WP_Query
- Is there a way to control both Order By and Order query parameters from one input field
- WP_Query & Duplicate entries
- WordPress For Loop Prints Unwanted Extra Paragraph Element
- return child post if available otherwise parent post
- Query by meta value (add a dropdown of all values)
- query_posts() doesn’t seem to be called in my page
- Fetching $_POST from Page Template into functions.php
- Query posts in current category but not attachment format
- WP_Query always returning the last custom post
- wp_query – Modify $query to include duplicate content
- How to get several fields from wp_query?
- Pagination not working with WP_Query (creates links but no page)
- query_posts with sorting on a custom datestamp
- Query custom post type by date field only working when two posts match the query
- Divide WP_Query posts by date & post type
- query by meta value then date and not empty meta value
- New WordPress WP Query using posts from certain categories