wordpress - Display List of Custom Post Type in Custom Theme -


i created custom post type "projects" 3 fields(name, title, technology) in admin panel , added list of projects.

i want display list of projects in custom theme.

can give me better reference understand , integration

you want array of posts, limited custom post type. use get_posts().

$args = array(     'posts_per_page'   => -1, // -1 here return posts     'post_type'        => 'project', //your custom post type     'post_status'      => 'publish', ); $projects = get_posts( $args );  foreach ($projects $project) {     printf('<div><a href="%s">%s</a></div>',             get_permalink($project->id),             $project->post_title); } 

Comments