WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Types (2 posts)

  1. Simon Ainley
    Member
    Posted 3 years ago #

    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?

  2. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    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)

Topic Closed

This topic has been closed to new replies.

About this Topic