WordPress.org

Ready to get started?Download WordPress

Forums

Display my custom post type (2 posts)

  1. Annwp
    Member
    Posted 3 years ago #

    I have searched a solution for several days. I really need help now! I have tried to make a custom post type. I can see the post type in the panel and I can write a post BUT I can't see the post when I click "show post". The post isn't there. It just shows the 404 not found page. I can see regular posts but not my custom post type. What is wrong?? I got the code from wordpress codex example.

    I wrote this in my functions file:

    add_action( 'init', 'create_post_type' );
    function create_post_type() {
    	register_post_type( 'acme_product',
    		array(
    			'labels' => array(
    				'name' => __( 'Products' ),
    				'singular_name' => __( 'Product' )
    			),
    		'public' => true,
    		'has_archive' => true,
    		)
    	);
    }

    Thanks in advance!

  2. Alx Block
    Member
    Posted 3 years ago #

    Do you have a page with the same name as your custom post type?

    I've seen it where http://yoursite.com/news conflicts with register_post_type( 'news',

    The bottom line being that you can't have a paged named the same as your custom post type.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.