How to display custom post type?
-
Hello there. I have created the child theme, registed the CPT named ‘software’ and created the file single-software.php in child theme folder. I copied the code from single.php file available in quicksand theme folder and made few changes referring to the tutorials available in the internet. But I cannot see the post display in my locally hosted site. Please help me how to make it work. I hope I am editing the right file. Thank you in advance.
Code I am using is:<!-- post-list --> <?php $args = array( 'post_type' => 'software', 'post_status' => 'publish' ); $loop = new WP_Query( $args ); if( $loop->have_posts() ) :?> <? while ( $loop->have_posts() ) : $loop->the_post(); // get_template_part('template-parts/content', 'single'); get_template_part('template-parts/content', get_post_format()); // If comments are open or we have at least one comment, load up the comment template. if (comments_open() || get_comments_number()) { comments_template(); } endwhile; ?>
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘How to display custom post type?’ is closed to new replies.