Forum Replies Created

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)