[wp-hackers] Custom Post Type Main Page
Daniel Cameron
dan at sproutventure.com
Wed Aug 4 15:55:21 UTC 2010
I'm using something very similar to this...
function template_include( $template )
{
if ( get_query_var('post_type') == 'videos )
{
if ( is_single() ) {
$template = locate_template( ...
}
else { // loop
$template = locate_template( ...
}
return $template;
}
}
add_filter( 'template_include', array($this, 'template_include') );
On Wed, Aug 4, 2010 at 8:29 AM, Devin Dixon <devin at tayloegray.com> wrote:
> Hey,
>
> I am creating a custom post type for videos. The post type looks
> something like this:
>
> register_post_type('videos', array(
> 'label' => __('Videos'),
> 'singular_label' => __('Video'),
> 'public' => true,
> 'show_ui' => true, // UI in admin panel
> '_builtin' => false, // It's a custom post type, not built
> in!
> '_edit_link' => 'post.php?post=%d',
> 'capability_type' => 'post',
> 'hierarchical' => false,
> 'rewrite' => array("slug" => "video-library", 'with_front'
> =>
> false), // Permalinks format
> 'supports' => array('title','author', 'editor' , 'thumbnail'
> ,
> 'excerpt' , 'page-attributes' )
> ));
>
>
> So the permalink looks like: http://mydomain.com/video-library/video1
> . My question is how do I get http://mydomain.com/video-library/ as a
> main page to list all the videos that have been posted?
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
--
Dan Cameron
Solution Engineer @sproutventure
http://sproutventure.com
Phone: (805) 288-2232
GTalk: dan at sproutventure.com
More information about the wp-hackers
mailing list