Support » Fixing WordPress » How to Show the Excerpts from a Custom Post Type

  • Hi folks,
    I am starting to play around with Custom Post types and am trying to figure out how to show the excerpts from a Custom Post type. I have a custom post type called testimonials and I am trying to show the excerpt of those on the home page. I cannot figure out how to do it…. any ideas?


Viewing 3 replies - 1 through 3 (of 3 total)
  • Now with those custom post types and other “bits of content” that don’t necessarily need to be organized by date/chronologically, what approach you suggest taking for letting the editor/admin of the site SORT their order??

    Not really sure what you mean, You mean how could they sort their order? Looks like there is a plugin that lets you do that sort of thing.

    But that doesn’t really answer my question as to how to call the excerpts of a custom post type. Anyone?

    Not entirely sure if this is the RIGHT way to do it but I am able to accomplish what I want using the following. So if your custom post type is called “testimonials” and you want to display the excerpt try this:

    //get specific post_types, display all published content for each of those types
    ‘name’ => ‘testimonials’
    $output = ‘objects’; // names or objects
    if ($post_types) {
    foreach ($post_types as $post_type ) {
    $type = $post_type->name;
    ‘post_type’ => $type,
    ‘post_status’ => ‘publish’,
    ‘posts_per_page’ => -1,
    ‘caller_get_posts’=> 1
    $my_query = null;
    $my_query = new WP_Query($args);
    if( $my_query->have_posts() ) {
    while ($my_query->have_posts()) : $my_query->the_post(); ?>
    <?php the_excerpt() ?>


Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to Show the Excerpts from a Custom Post Type’ is closed to new replies.