• Home
  • WordPress Maintenance & Support
  • Pricing
  • My Account
  • Home
  • WordPress Maintenance & Support
  • Pricing
  • My Account
home/Knowledge Base/Wordpress/How to create a custom post type in wordpress ?
Popular Search:Wordpress white screen

How to create a custom post type in wordpress ?

12 views 0 October 16, 2022 info_c0xde61d

We often need to add a new post type in WordPress beside the POST and PAGES menu.

Below is a sample PHP code below to write in the theme or plugin function file.

add_action( 'init', 'create_posttype_qr_code' );
function create_posttype_qr_code() {
	    register_post_type( 'ogpqrcode',
	        // CPT Options
	        array(
	            'labels' => array(
	                'name' => __( 'QR Code' ),
	                'singular_name' => __( 'QR Code' )
	            ),
	            'public' => true,
	            'has_archive' => true,
	            'rewrite' => array('slug' => 'analyses'),
	            'show_in_rest' => true,
	            'supports' => array('title')
	        )
	    );
}

Feel free to contact our wordpress support if you need to install more advanced custom post type.

Tags:post_typephp code

Was this helpful?

Yes  No
Related Articles
  • How to Fix “Briefly Unavailable For Scheduled Maintenance. Check Back in a Minute.”
  • How to add new column on a custom post type in WordPress back-office?
  • How to create a custom post type in wordpress ?
  • How can I get help with WordPress?

Didn't find your answer? Contact Us

Wordpress
  • How to create a custom post type in wordpress ?
  • How to Fix “Briefly Unavailable For Scheduled Maintenance. Check Back in a Minute.”
  • How to add new column on a custom post type in WordPress back-office?
  • How to create a custom post type in wordpress ?
  • How can I get help with WordPress?
KB Categories
  • Wordpress
  • WooCommerce
  • Domain name & Hosting

  How to Fix “Briefly Unavailable For Scheduled Maintenance. Check Back in a Minute.”

How to add new column on a custom post type in WordPress back-office?  

WooHelp offer professional WordPress, WooCommerce assistance and WordPress support by our expert developers. We will do backups, updates, security, speed optimization and create custom plugins. We also offer fast WordPress fix services for any emergency.

Support Links
  • FAQ
  • Forums
  • KnowledgeBase
  • Documentation
Useful Help Links
  • Community Home
  • Item support
  • Refunds
  • Market API
  • Privacy Policy
  • Terms of Use
  • Copyright 2022 WooHelp - Wordpress WooCommerce Developer.

Popular Search:Wordpress white screen