• I am looking to customize the listing page of my custom post times.

    Right now it seems to be using the default listing page.

    Is there anyway I can override this and create a custom listing page, just for this custom post type?

Viewing 1 replies (of 1 total)
  • For you listing you need to create a template file in you there.For example for the post type “properties” your template file name could be properties.php.Now to list the properties post type you need to adda template redirect action like bellow.

    add_action("template_redirect", 'my_template_redirect');
    
    	// Template selection
    	function my_template_redirect()
    	{
    	    global $wp;
    	    global $wp_query;
    	    if ($wp->query_vars["post_type"] == "properties")
    	    {
    	        // Let's look for the properties.php template file in the current theme
    	        if (have_posts())
    	        {
    	            include(TEMPLATEPATH . '/properties.php');
    	            die();
    	        }
    	        else
    	        {
    	            $wp_query->is_404 = true;
    	        }
    	    }
    	}
Viewing 1 replies (of 1 total)
  • The topic ‘Custom Post Type Listing Page’ is closed to new replies.