You register a post type named “latest news”, but you seem to already know that, so I am unsure what the question is. Do you want someone to copy and paste from the Codex for you, and change a couple of text strings?
function codex_custom_init_v2() {
$args = array( 'public' => true, 'label' => 'Latest News' );
register_post_type( 'latest-news', $args );
}
add_action( 'init', 'codex_custom_init_v2' );
You can then customize the post type archive by creating an archive-{post_type}.php
file and customize the single post display by creating a single-{post_type}.php
file.
Related Posts:
- Is it possible to define a template for a custom post type within a plugin independent of the active theme?
- Creating a default Custom Post Template that a Theme can override
- Template for custom post type shows all posts instead of just one
- Get image URL from media library in input
- How can I use a file in my plugin as a replacement for single.php on custom-post-type query?
- How to provide page_template path in custom plugin using WordPress
- Tips for using WordPress as a CMS? [closed]
- Custom Post Type Templates from Plugin Folder?
- Pass PHP variable to javascript
- How to Remove Certain Screen Options and Meta Boxes from add/edit post type?
- Is it possible to stop selected plugins from loading on certain template pages?
- How to make a list of companies’ information and display them to user, using custom post types and a custom taxonomy?
- Template plugin for blog posts? [closed]
- remove custom taxonomy metabox form custom post type
- [Plugin: Posts 2 Posts] reciprocal connections
- Custom Post Type Statuses
- How do I add a template to a theme using a plugin?
- How do I make a wordpress plugin with menu item etc
- add_meta_box Callback not being called
- Star rating for custom post types [closed]
- How to Make a Custom Grid View
- Way to hook into a sidebar call to replace it with a custom sidebar
- taxonomy_template filter do not loads custom taxonomy template properly
- wordpress reusable content blocks
- More than one text-domain is being used because of the included templates for plugins
- how do i remove posts from a WP_Query so the pagination is right?
- Loco Translate: Custom Post and Custom Taxonomy Labels not translated in wp-admin menu
- Accessing post’s meta data based on user’s click of a post
- WP Post Template – Templates in own folder
- Plugin custom post type – Internal server Error
- Is it possible to create Custom Post plug-in?
- List taxonomy terms for post as checkboxes
- How to make a proper custom post type link
- Matching Chapters to a Custom posts [closed]
- Add comments for template variables
- Mq translate plugin custom post type issue
- Render custom php template into string
- How to use get_template part in the plugin?
- What is the best way for showing a grid of customer logos?
- How to delete all trashed item in one-go
- Best practice for including plugin output in a template without using shortcode?
- How do I override plugin templates and stylesheets?
- Edit Permalink Structure For Custom Post Type or Modify .htaccess?
- Default taxonomy template in plugin, override in theme
- How to use template_include hook with form submission?
- Trying to add a page template for my custom post type from a plugin, but it will not display in the template dropdown unless file is in theme
- Custom Post Type – custom form in dashboard
- $pages = get_pages(‘child_of=’.$post->ID); Why arguments are concatenated?
- Pagination shows Same posts
- WP-API Custom Post Type json_no_route
- Price comparison table based on Custom Post Type?
- How can I list custom post type categories of portfolio
- Show related posts based of current ACF field name in a single page post (a loop within loop)
- Plugin generated unexpected output – No PHP errors
- “Allowed memory size” problem [closed]
- Woocommerce – Change Variable Product Add to Cart to behave like external product using Custom Field (link) [closed]
- Prevent plug-in scripts on a specific template?
- Including content from legacy app: via plugin or custom content?
- Dictionary-style definition list plugin
- Multiple Post Thumbnails Plugin – Need help with code
- Wp-minify doesn’t seem to minify my JS code
- Custom Post Type, Custom Columns List
- Error Metabox Warning: call_user_func() expects parameter 1 to be a valid callback
- Pass PHP variable to javascript
- need click to clipboard button on my site
- Setting Author on CPT
- Create category for each user
- Enqueue css to a third-party plugin template
- Adding category base to url in custom post giving 404?
- custom post type plugin error [closed]
- Undefined index: custom_post_template_present
- Problem with checked box on wp car manager plugin
- Merging new theme and plugins from development site to production
- $wpdb->insert not working inside save_post tag
- How to add post title to custom php?
- Is it possible to customize a wordpress post from outside dashboard(Something like site.com/post-type/post/?e=post_id)?
- How to access Post Archive created by Elementor?
- Accessing download link from the loop with WP Download Manager Pro
- Programmatically generate new pages for a site based on page template and content elements accessed via DB
- How to change the deafult template in WordPress plugin
- WordPress arrows dissapeared strange signs
- WP plugin calls for custom pages
- Calling an custom field from theme option at the frontend
- Creating themes using the one Plugin (Toolkit)
- How to add jquery to my custom post type wp plugin
- WordPress list child pages of custom post type
- WordPress custom posttype meta values doesnot save
- making a glossary with wordpress
- show Visual form builder in the front end
- Fake Single WordPress Post (Page) Loop
- Synch Custom Post Types (and Custom Fields, Cats, etc.) Between WordPress Sites
- WordPress multisite haml templates
- get_option include in my adsense
- WordPress Custom post type won’t save properly
- Remove base from the custom post type URL [duplicate]
- Make a Custom template for a specific category in wordpress
- Display Custom Post Type and Custom Taxonomy Data on Front End Using Only a Plugin
- Template library for WordPress [closed]
- Filter custom post type returned from REST api
- How to make content as required in custom post type?