[wp-testers] new custom post types - problem viewing new custom post

ampt notfornoone at gmail.com
Thu Apr 29 23:49:52 UTC 2010


Did you regenerate the permalink structure?
Try visiting the Permalinks page under Settings in the WP Admin, this
will update the permalink structure. Then see if you can view your
custom post.


On 30 April 2010 05:26, Danny G Smith <dgs at riskiii.com> wrote:
> I have created a new custom post based on the code I saw in a presentation by Aaron Brazell, but modified for my use.  I am going to create these types to be used with a jQuery slider to give me a rotated featured image, and more than one instance, as is currently available in current plugins.
>
> The problem, after I create the page, and click on "View Carousel Posts", I get a 404 page.  Can anyone see a problem this the code?
>
> Now for the code for the custom post type:
>
> $carousel = new Carousel;
>
> add_action('init', array($carousel, 'carousel_tax'),  1);
> add_action('init', array($carousel, 'carousel_type'), 2);
>
> class Carousel {
>
>   function __construct() {}
>   function __destruct()  {}
>
>   function carousel_type()
>   {
>      register_post_type('featured', array(                                          // first var is part of the permalink
>         'label'                 => __('Carousel Posts', 'carousel-container'), // first var used in left hand menu
>         'execute_from_search'   => true,
>         'public'                => true,
>         'capability_type'       => 'post',
>         'hierarchical'          => false,
>         'supports'              => array(
>               'title',
>               'excerpt',
>               'editor',
>               'thumbnail',
>               'revisions',
>               'custom-fields'
>               ),
>         'taxonomies'            => array('post-tag', 'category', 'carousel-tax')
>         )
>      );
>   }
>
>   function carousel_tax()
>   {
>      register_taxonomy('carousel-tax', 'carousel-container', array(
>         'hierarchical'    => false,
>         'show_ui'         => true,
>         'label'           => __('Page where Carousel Posts will show', 'carousel-container') // first shows up on  the page, second used to reference
>         )
>      );
>   }
> }
>
>
>
> _______________________________________________
> wp-testers mailing list
> wp-testers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-testers
>


More information about the wp-testers mailing list