Support » Plugin: Toolset Types - Custom Post Types, Custom Fields and Taxonomies » Displaying custom post types without the Views plugin

  • Resolved Balint Toth



    I really love the Types plugin because of it’s simplicity. I was thinking, is it possible to display the custom post types created with this plugin, in category, taxonomy listing pages and in single-post, but without the Views plugin? Because at this point I don’t want to pay for that.

    I have checked the Types plugin documentation, but everywhere I could see it mentions displaying custom post types, it mentions the Views plugin only…

    Any insights and help will be greatly appreciated!

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi Balint

    Of course, you can show your custom post types by raw PHP code. This is a sample code:

    $args = array( 'post_type' => 'product', 'posts_per_page' => 10 );
    $loop = new WP_Query( $args );
    echo '<div class="product-list">';
    while ( $loop->have_posts() ) : $loop->the_post();
    	if (has_post_thumbnail()) : ?>
    	<a class="thumb" href="<?php the_permalink() ?>" rel="bookmark"><?php the_post_thumbnail('full'); ?></a>
    	<?php else: ?>
    	<a class="thumb" href="<?php the_permalink() ?>" rel="bookmark">
    		<img src="<?php echo get_template_directory_uri().'/images/product-default-thumb.jpg'; ?>" />
    	<?php endif;
    	echo '</div>';
    echo '</div>';
    Balint Toth


    Thank you very much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Displaying custom post types without the Views plugin’ is closed to new replies.