Jump to content


Photo

Custom Post types?


  • Please log in to reply
1 reply to this topic

#1 augemundial

augemundial

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts

Posted 03 August 2011 - 05:45 PM

I've created a custom post type named "companies". I've read some tutorials and seems like I only have to include a companies.php with a loop within the code in order to get a listing of my posts. But that's not working. Does pagelines support custom post types? what is the correct way to get a listing of my elements? thank you

#2 kastelic

kastelic

    Advocate

  • Members

  • 3081 posts
  • Country: Country Flag

Posted 03 August 2011 - 10:07 PM

You just need to set your post type to "has archive", and it will create one in http://yoursite.com/companies.
If you used a plugin like Custom Post Types UI then it has this option.

If you want to see your custom post types on the home page you can paste this function in platformbase/functions.php:

 
		// enables any post type
		add_action('pagelines_inside_top_theloop' ,'enable_custom');
		function enable_custom(){
			if (is_home()){
				$args = array(
					'post_type'=> 'any',
				);
				query_posts($args);
			}
		}