display cutom post type

Send Snippet To: Save this snippet to Code Collector Pro -- view all _co._'s snippets
language: Other
license: Other

Code for Snippet:

                
			<?php 
 
				//Define your custom post type name in the arguments
 
				$args = array('post_type' => 'quotes');
 
				//Define the loop based on arguments
 
				$loop = new WP_Query( $args );
 
				//Display the contents
 
				while ( $loop->have_posts() ) : $loop->the_post();
				?>
				<h1 class="entry-title"><?php the_title(); ?></h1>
				<div class="entry-content">
				<?php the_content(); ?>
				</div>
			<?php endwhile;?>
comments powered by Disqus

Info

Link to this snippet:


Download to Code Collector

To use the direct link to your snippet on CodeCollector.net either copy the html from the above section or drag the Download to Code Collector to where you would like to use it.

More Info:

Times Viewed: 311
Date Added: 2015-11-22 21:38:55
Last Modified: 2015-11-22 14:39:05

Web Analytics