[wp-testers] Custom Post Type + many template

Deanna Schneider deanna.schneider at gmail.com
Tue May 4 11:05:29 UTC 2010


You can use the template redirect to include file in your plugins directory.

// Template selection
	function template_redirect()
	{
		global $wp, $wp_query;
		
		if ($wp->query_vars["post_type"] == "abcd")
		{
					
			get_header();
			// include your custom processing code here
			get_sidebar();
			get_footer();

			die();
		} // end if to determine if we're doing anything with this redirect
	}

add_action("template_redirect", array(&$this, 'template_redirect'));

On Mon, May 3, 2010 at 6:34 PM, unsalkorkmaz <unsalkorkmaz at gmail.com> wrote:
> Hi,
> I want to use custom post types but i couldnt find "how to add custom
> post type template support from plugin directory"
>
> Basically lets say i want to have "abcd" named post type. I dont want
> to put a file on every template and i want to define single-abcd.php
> file location in plugin directory without editing template files. Is
> it possible?
> _______________________________________________
> 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