WordPress.org

Support

Support » How-To and Troubleshooting » Custom Post Types

Custom Post Types

  • Simon Ainley

    @simonainleydotinfo

    I am trying to work with custom post types, I am using the custom post types plugin, rather than coding them in my functions.php file. My problem is that I cannot get the posts to show on the webpage. My posts can be found at an URL such as /current-projects/project-1. However all I get is blank page, I have tried adding a single.php to my theme, also a current-projects-single.php and current-projects-page.php but still nothing.

    How can I add my custom post types so that are availble in my theme?

Viewing 1 replies (of 1 total)
  • not sure about the plugin….. but normally you have to query them using query_posts

    query_posts( array(
    	// Set post type
    	'post_type' => 've_products',
    	// Enabled paging
    	'paged'=> ( get_query_var('paged') ? get_query_var('paged') : 1 ),
    ));

    for instance before the loop on my shop page template calls my ve_products custom post type (the rest of that code is so that pagination will work)

Viewing 1 replies (of 1 total)
  • The topic ‘Custom Post Types’ is closed to new replies.
Skip to toolbar