Have a look at the orderby
parameters for WP_Query
to see all of the valid values that can be.
If wpcf-start-time
is a meta key, then orderby
should be meta_value
, which will also require you set a meta_key
argument to tell WP what meta key you want to order on-
} elseif ($q->is_post_type_archive('cif-events')) {
$q->set('orderby', 'meta_value');
$q->set('meta_key', 'wpcf-start-time');
$q->set('order', 'ASC');
$q->set('posts_per_page', 300);
}
Related Posts:
- Adding ‘menu order’ column to custom post type admin screen
- Custom post type pagination 404 fix?
- Filtering a custom post type by custom taxonomy in archive template
- get term archive url / link
- How to get the custom post type from an archive page?
- Displaying a custom post type alphabetically
- How to remove “Archive:” label from archive title
- Proper way of making custom post type landing page or archive page
- Custom Post Type Archives by Date with Custom Permalink
- Ordering posts having multiple post-meta date fields
- Display Editable Text Above CPT Archive Listings
- Custom Post Type Archives with 0 Posts Redirects as 404
- Archive page with multiple taxonomies rewrite
- Archive page…limiting posts per page
- WP 3.1 – archive pages for custom content types possible now without a plugin?
- Date archives for custom post type
- Order Posts by Taxonomy and Meta Value
- Custom comment status possible?
- Custom Post type sort order not working in the admin area
- paginate function in archive for custom-post-type
- ascending order custom post type
- query order by date on custom type: wrong order
- Call different archive page based on post type
- Taxonomy list. Order by a specific custom post type count
- How to create archive page for taxonomy terms within custom post type
- Category and post tag archives do not include posts from custom post type
- Display custom post types with custom date field value (before today) & order by custom date field
- How to list custom post types?
- Display CPT description on archive.php pages for all CPT
- When ‘is_post_type_archive()’ return true?
- I did group my search results by post type, but how can i give each of them its own order?
- Changing number of posts per page on CPT-archive.php, have tried 20-30 code chunks so far
- Ordering posts in Search & taxonomy by post_meta
- Custom Post Type Archive Page Filtering
- How to modify archive query with pre_get_posts to append CPTs?
- How to set order for a custom post type
- URL of a custom post type’s post format archive?
- Create template for taxonomy results limited by Custom Post Type
- Change CPT archive title
- WordPress showing archive.php instead page
- How to order and group custom post type posts by year and month
- The loop seems stuck to a single (now deleted) post
- Use “archive” as slug for custom post type
- Is it better to use filter for the_content in archive pages?
- Manage Columns : order by post_parent’s title
- How can I get this request to use the Custom Post Type page template instead?
- Add a custom meta box for client to order CPT posts how they want
- What’s the name of the custom post type yearly archive template?
- multiple custom post type on category page
- Assign CPT archive page attributes
- Custom taxonomy or custom page templates?
- Can anyone clarify difference between archive-{posttype}.php, type-{posttype} and date.php?
- How do I add custom HTML to the content of an archive page’s posts?
- Only show posts with a specific term of an associated taxonomy in a custom post type archive
- Use the custom post type archive for taxonomies?
- Display Date & Author Info on Custom Post Type Archive Page
- How to constrain the results to a specific post_type on tag archive page?
- Get the link of the first post of a custom taxonomy in a custom taxonomy list
- Filtered by a custom field, ordered by another
- Adding Page Ordering to a Custom Page Type
- How to prevent a custom post type from using the archive.php template?
- Displaying Portfolio Filter by Category Order (alphabetically)
- Event Archive by Month
- Custom Post Type Date Based Archive URL rewrite [duplicate]
- How can I tell if I’m on a custom post type archive page?
- Order posts by taxonomy terms
- wp rest api orderby field in a custom table
- Custom Post type page content (archive page)
- Set up Custom Taxonomy Archive Template File To Cover 3 Categories
- Group custom post type posts by month
- order custom post type posts by custom date
- Custom WordPress theme not displaying posts from category
- Creating an archive page or simple template to list all values of a custom field of specific post type listing
- Custom post types not showing on the standard WordPress Category page
- Wp Query sort order from custom MetaBox
- Turning archive templates to a page template maintaining the slug
- Order archive custom posts by taxonomy term [duplicate]
- Custom Archive – hide posts until a search is made?
- How to sort custom post’s category by id from the theme’s function.php?
- Show first posts with custom field not empty and order all by title
- Custom Post Type tag taxonomy “Page Not Found”
- Rewriting archive page slug to be different than custom post type slug
- Custom Post type archives / categories give 404
- How to display custom post type ordered by a custom field date
- Archive.php is not displaying tags
- Custom Post Type Order Index Loop
- Ordering custom post type by custom field without a title
- Custom post type category page not working
- Custom post types with date based archive
- paging is not working properly on news archives page [duplicate]
- Categories in custom post types
- Create custom post order (with custom post type meta)
- is_singular won’t call my functions?
- How to turn custom-post archive into an overview page, listing the metadata of the posts?
- Allow admin to determine the order of queries?
- how to pass args for archive.php query?
- How to have a dynamic slug and rendering the archive-{post_type}.php?
- Remove plugin’s custom post type archive page and single pages [closed]
- WP Query + custom fields: How to query event posts from the current date backwards 6 months and organize it month by month?
- WordPress CPT archive page display sticky post first and then display the rest of the posts in same Query