Return to Snippet

Revision: 50467
at August 23, 2011 22:22 by i-am-andy


Initial Code
<?php $loop = new WP_Query( array( 'post_type' => 'vehicles', 'posts_per_page' => 30 ) ); ?>

<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>

<div class="vehicle_repeater"> <a href="<?php echo get_permalink(); ?>"><?php echo get_the_post_thumbnail($page->ID, ''); ?></a>
  <div class="vehicle_text_box">
    <?php the_title( '<h4><a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark">', '</a></h4>' ); ?>
    <p class="vehicle_small_text">
      <?php
                    $myExcerpt = get_the_excerpt();
                    if ($myExcerpt != '') {
                        // Some string manipulation performed
                    }
                    echo $myExcerpt; // Outputs the processed value to the page
                    ?>
    </p>
  </div>
</div>
<?php endwhile; ?>

Initial URL

                                

Initial Description
Get posts from a Custom Post Type

Initial Title
Get Posts from Custom Post Type

Initial Tags
post

Initial Language
PHP