WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Custom Post Type (7 posts)

  1. Seb Syd
    Member
    Posted 1 year ago #

    WordPress 3.5-beta-1 using Twenty Twelve Theme does not work.
    The custom Post Type registers in the dashboard.
    The Custom Post appears in the Draft Format preview.
    When the post is published I get the message "This is somewhat embarrassing, isn’t it?" .
     
    Using WP 3.4 with Twenty Twelve the Custom Post works fine.

  2. What are your permalinks set to?

    And what code did you use to make your CPTs?

  3. Seb Syd
    Member
    Posted 1 year ago #

    Permalinks:-
    Post name http://example.com/sample-post/
    Code for CPTs:-
    <?php
    function create_post_type() {
    register_post_type( 'mysite_reviews',
    array(
    'labels' => array(
    'name' => __( 'Reviews' ),
    'singular_name' => __( 'Review' )
    ),
    'public' => true,
    'menu_position' => 5,
    'rewrite' => array('slug' => 'reviews')
    )
    );
    }
    add_action( 'init', 'create_post_type' );
    ?>

    This is set up using child of twenty twelve, on a 3.5 beta I upgraded today 9 10 2012.

    It works on all permalinks as a draft but not as a published Post.
    Does not work using Permalinks:-
    Numeric http://example.com/archives/123
    Post name http://example.com/sample-post/
     
    Works as using Permalinks:-
    Default http://example.com/?p=123
    Day and name http://example.com/2012/10/08/sample-post/
    Month and name http://example.com/2012/10/sample-post/

    I hope this helps.

  4. Seb Syd
    Member
    Posted 1 year ago #

    Sorry should have read:-
    It works on all Permalinks as a Draft.

    Does not work using these Permalinks as Published:-
    Numeric http://example.com/archives/123
    Post name http://example.com/sample-post/

    Works on these Permalinks as Published and Draft:-
    Default http://example.com/?p=123
    Day and name http://example.com/2012/10/08/sample-post/
    Month and name http://example.com/2012/10/sample-post/

  5. I tried your example code and I couldn't reproduce your issue on 3.5 Beta 1/trunk. If you register a new post type and don't visit and re-save Settings > Permalinks to flush the rules then most of the time you'll get a 404. I'd suggest maybe try registering a different sample post type, flushing the rules and see if you can't get past the 404's.

  6. Seb Syd
    Member
    Posted 1 year ago #

    Thanks for your reply,
    Yes the Permalinks needed Flushing,
    All fixed.

  7. Jguiss Webmaster
    Member
    Posted 1 year ago #

    All fixed too, thanks :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.