Create a front-page.php
file in the theme and query for the latest post of your post type.
$args = array(
'post_type' => 'yourtypename',
'posts_per_page' => 1,
'ignore_sticky_posts' => true,
'post_status' => 'publish',
}
$latest = new WP_Query($args);
if ($latest->have_posts()) {
while ($latest->have_posts()) {
$latest->the_post();
the_title();
// etc
}
}
See the Template Hierarchy for information about files that are “automagically” loaded..
Related Posts:
- Why does my custom WP role need edit_posts to edit images?
- How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy
- How to filter by custom post type on Gutenberg “Latest Posts’ block
- How can I list all the categories under a Custom Post Type (taxonomy)?
- Multisite wide post type?
- How do I remove all the metaboxes for a custom post type?
- How to list/show all custom post types regardless of category?
- Remove CPT slug from URL
- How to sort a table of custom posts by column containing custom field
- I have a CPT that have menu_order enabled, how can I make the menu_order values unique so it won’t have duplicates
- Add pre-existing meta box to new custom post type
- WordPress metabox file upload in custom post [duplicate]
- tags & categories with custom post type
- Querying Posts by Taxonomy From Alternate Network Site
- working Custom Post Type and Widget code no longer works when moved from functions.php to plugin
- Combine tax_query and meta_query in WP_Query
- Archive filter disappears on no results?
- How do I add a custom button to my “edit” list? ( edit.php?post_type= ) beside “Add New”
- automatically save custom post type title as a category
- How do I display custom post types through a common taxonomy?
- How do you remove slug altogether from custom post type?
- Get all of user’s custom post types in WP Admin for plugin
- How to Get Current Custom Post Type Selected Taxonomy Term (Not All Terms)
- Does anyone have a plugin that could automatically tag custom post types in wordpress?
- WordPress or Drupal for data-heavy content site
- Unusual Custom Post 404 problem (NOT a permalink issue)
- WP_Query: include custom post type only with specific meta value
- Relative URLs for a particular custom post type?
- Custom Post type in Author.php
- How to add and display reCAPTCHA in password protected form?
- How can I dynamically add a post to a custom post type which uses a custom field?
- get_comments not working on custom post types
- Custom Post hierarchical to custom taxonomy
- ACF From & To Date Validations
- Displaying all taxonomies without custom posts?
- WordPress showing archive.php instead page
- Query Multiple Custom Posts by Custom Fields
- How to Upload CSV Data into Custom Post Type Data with Metabox programmatically
- Displaying Custom Posts on a Page
- API Rest Custom Post Type doesn’t return all data
- Permalinks for custom post type
- Custom REST endpoints for a custom post type with custom fields
- WordPress Custom Post Type is not working properly
- Rewrite rule for Custom Post Type Page as a parent
- Multiple post types
- Show fields based on taxonomy selection in editor
- Permalinks: custom structure for taxonomy – tags?
- Custom Post Type & Meta Box – Displaying meta box information on front end?
- How to Get the title of a custom field?
- Loop for custom post types filtered by a taxonomy
- Ordering Submenu Pages in WP 3.1
- Template for custom post type when taxonomy is in the URL
- Why WordPress is picking archive.php instead of page.php?
- Custom Post Type posts, conflict with posts after add_rewrite_rule to top
- Get data from PHP to JavaScript to set position of each post on front page
- Child theme blocks post from publishing [closed]
- How should i sort “Last Update” Custom Column?
- How to query for posts (hierarchical custom post type) that have children but are NOT top level?
- How to query custom post type by two terms?
- Make a page an archive of a custom post type
- Incorrect ordering of custom post type based on time
- Redirect to URL if x number of days passed
- How to controll the Posts post type and general wondering about WP data structure
- Make Next and Previous on single-$posttype.php use the same order as archive-$posttype.php
- WordPress general content best pratices
- Posts 2 Posts plugin: best way to change connection field value?
- Stop displaying Permalink
- Auto Generate Post Title from 2 Custom Fields
- Enforcing a rigid reusable template structure for similar posts?
- Custom posts stopped working after moving to new domain
- How to change the comments form title based on post type
- Unable to gather Image URL from Custom Post Type’s; Custom Meta Field
- How can i redirect click to new admin page not to edit screen in post table
- Shortcode and get_template_part
- Grid slider with custom post type (how to filter with taxonomies?)
- Custom post pagination not working
- Two and more diffrent custom page type in one permalink
- Duplicate posts in my custom loop
- How to display a custom post as a page (but unedited)?
- How to override post-new.php with custom template
- Set a static page as a user profile page?
- Why get_posts() returns empty array while I am trying to get posts from some specific taxonomies and work properly with others?
- Populate metabox dropdown with post title from another Custom Post Type (issues with wp_reset / global $post)
- Meta box not saving
- Display subcategories in the filter on CPT
- Rewriting archive page slug to be different than custom post type slug
- Shortcode display CPT Query only showing 1 post?
- Default taxonomy ‘post_tag’ added to CPT managing by custom role : nothing in the metabox
- Query stopped working
- Setting a custom $query->query_vars[‘meta_key’] breaks the WordPress menu
- Filtering in admin broken for custom post type in 3.8.1?
- Get Registered Custom Post Type to get All Custom Taxonomies
- Custom pagination [duplicate]
- WordPress loop to pull 4 pages/posts by ID
- Re-using single CPT code with get_template_part?
- how to show perticular category posts in custome page
- Custom Post Types and 404 Pages
- create gallery page for specific post id
- Bulk update custom post types
- Adding a custom field after post title (ex.Example Title [30 Second Read])