<?php
$args = array(
'posts_per_page' => -1,
'post_type' => 'event',
'meta_query' => array(
array(
'key' => 'event_date_end_timestamp',
'value' => time(),
'type' => 'numeric',
'compare' => '<'
)
)
);
$programs = new WP_Query($args);
?>
<?php while($programs->have_posts()): $programs->the_post(); ?>
<h1><?php the_title(); ?></h1>
<?php endwhile; ?>
Related Posts:
- Why Query is returning empty array?
- How to limit the number of posts that WP_Query gets?
- Should we trust the post globals?
- Random sort within an already sorted query
- How to know if get_posts() failed?
- post__in for get_posts with a dynamic array
- Using $wpdb to query posts with meta value containing current post_id
- WP_Query to work with custom view
- WordPress Number of Posts Not Changing With posts_per_page
- How to add posts to wp_query result?
- Should ‘setup_postdata()’ be reset with ‘wp_reset_postdata()’?
- Replace Main Query With Custom Query
- Search query – exact post title match
- posts_per_page doesnt work
- How to start with post number x?
- Exclude posts with empty post_content in wp_query
- Only display a certain number of posts, dependent on how many posts there are available in a query
- Improving WP_Query for performance when random posts are ordered
- Should $found_posts be returned as string in ‘found_posts’ filter hook?
- Get Posts that are in the current month or later
- How to do set post permalinks using 6 digit random unique function?
- Exclude the first ‘n’ number of posts of a tag from home page?
- posts_per_page option limits the number of Gallery items
- wp_posts table: safely remove unused columns to save database storage
- Inner join overrides Advanced Custom Fields plugin’s get_field [closed]
- Do not show children of a category
- Query for first 3 posts to change the look and feel
- Why posts array is empty?
- How to give classname to post if post has no content?
- Exclude some posts from displaying in wp_query based on some condition
- Related Posts function not working
- How to retrieve certain number of images from a wordpress post?
- How to convert query sql to shortcode in wordpress?
- How Can I Always Display A Particular Post First Using WP_Query?
- WordPress Query – Display 5 posts (same post type), each from a given tag
- filter posts based on menu_order
- Show 5 posts and than 3 posts offset with pagination
- wp query custom orderby not custom field
- Sort / Filter Queries
- Advanced Post Display/Pagination/Ordering
- Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?
- Why I have this strange behavior when I try to exlude the featured post from posts visualization?
- Displaying Results From Custom Taxonomy Query
- WP_Query retrieve custom posts but not the post showing
- Wp_query WooCommerce products
- WP_Query post_tilte search in posts table
- How to make WP_Query faster when getting a post from one year ago?
- My custom query is displaying random posts in random order
- Creating Ordered Query using Meta_key
- Sort Events by Venue Title – Sort Post set by related post ids
- Is there a global page/post/product/anything ID?
- Custom layout manager for posts
- Get query result according to merged array
- Blog only showing one post even though more published
- wpdb get_results() returns only 2 rows
- WordPress loop uses unmodified posts array, why?
- Display WordPress Post By Date
- Query post for today, if no post get the previous one
- Custom Select Query pagination not working properly
- GUID to related post not in current language
- I am not getting result from php function that is json encoded
- Query post by meta key of another table
- Get results from the main wp_query
- Query post category & remove any post id
- How can I display a specific number of post in a category via a url
- Show posts between two Custom Fields date
- Display the latest post from some selected authors
- WP Query between posts custom fields [duplicate]
- Query to get data of a post, if in category?
- Order posts by custom field
- Ordering posts alphabetically by meta keys and title
- How to show the posts list into a static page? Problems to use the loop into a static page
- Save/retrieve form data best practises for theme development
- Grab next post title in archive page
- How do I control the fallback query after the original query returned cero posts?
- Removing a post from the results of a WP Query
- Remove duplicated posts in the loop if post has more than one category
- Query posts from a specific category and selected tag
- Continuous listing from a custom field
- Pagination for custom query won’t let me back on page 1
- Order posts by separate menu order for different sub-categories
- Retrieve latest post by multiple categories with ID
- Adding a category at even positions on main loop with modified pagination
- Query Posts From Multiple Post Types
- Sort post by category using HTML Select tag
- Make assigning post to a specific category equivalent to assigning it to all categories
- How to store post rating system data post independent?
- Update Post with Modified Data
- Multiple loops on a Search result page?
- Get first comment link on the post itself
- Can’t get pagination to work
- How to Include a common category in a custom Category Search
- Why I getting only 1 post?
- The next_posts_link() works only with original $wp_query
- Special Query: Title, Terms, Content – %LIKE%
- What is wrong with this wp_query?
- wp_query select if have comments
- WP_Query: Fetch posts that are in (category1 and not in category2), OR posts that are not in cagegory1
- Creating pages and getting their values from the database table
- Make division in post_query?