• Hello,

    I am having the hardest time trying to set up a testimonials page on my site. I purchased a plugin that manages testimonials through custom post types. I am trying to get all of the custom post type testimonials (unlimited number) to show up on my site’s testimonial page (www.photographybyericah.com/wordpress/client-testimonials).

    The testimonials plugin that I purchased uses custom post types to enter each testimonial. It only came with the shortcode to show one testimonial on the page. I need to show all of them. Ultimately, I want the page to be paginated so that the page length doesn’t go on forever. But, right now I can’t even seem to get all of them to show up. Can anyone help me with this. If I need to post other files, I can do that too.

    I created a custom page template (testimonials-page.php) with the code below. I have also included the single-testimonial.php page that I created and the plugin’s shortcode testimonial.php (template for displaying all single posts)

    TESTIMONIALS-PAGE.PHP
    ———————————————————————
    <?php
    /*
    Template Name: Client Testimonials

    */
    ?>

    <?php get_header(); ?>
    <div id=”container”>
    <div id=”main”>
    <h2>Client Testimonials</h2>
    <p>My clients have kindly provided the following testimonials. If you would like to share your experience, please fill out the “Submit Your Testimonial” form to the right. I look forward to hearing from you! </p>
    <div class=rule></div>
    <div class=”testimonial”>
    <div class=”left-quote”> </div>
    <div class=”testi-text”>
    <?php query_posts(‘testimonials=post&numberposts=-1’); ?>
    <?php if ( have_posts() ): ?>
    <?php while ( have_posts() ): ?>
    <?php the_post(); ?>
    <div id=”post-<?php the_ID(); ?>” <?php // post_class(); ?>>
    <?php if ( is_front_page() ) : ?>
    <?php $queried_object = $wp_query->get_queried_object(); ?>
    <?php $subtitle = get_post_meta($queried_object->ID, ‘subtitle’); ?>
    <?php $title = the_title( ”, ”, false ); ?>
    <?php endif; ?>

    <div class=”entry-content”>
    <?php the_content(); ?>
    <?php wp_link_pages( array( ‘before’ => ‘<div class=”page-link”>’ . __( ‘Pages:’, ‘simplicius’ ), ‘after’ => ‘</div>’ ) ); ?>

    <!– <?php edit_post_link( __( ‘Edit’, ‘simplicius’ ), ‘<span class=”edit-link”>’, ‘</span>’ ); ?> –>

    </div><!– .entry-content –>
    </div><!– #post-## –>

    </div>

    <?php endwhile; ?>
    <?php endif; ?>
    </div><!– /#content –>

    </div><!– /#container –>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

    ———————————————————————–

    SINGLE-TESTIMONIALS.PHP
    ————————————————————————

    <?php
    /**
    * The Template for displaying all single posts.
    *
    * @package WordPress
    * @subpackage Twenty_Ten
    * @since Twenty Ten 1.0
    */
    $custom_fields = get_post_custom($post->ID);
    $client_name = $custom_fields[“name”][0];
    $Location (City, State) = $custom_fields[“Location (City, State)”][0];

    get_header(); ?>
    <div id=”container”>
    <div id=”main”>

    <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
    <!–
    <div id=”nav-above” class=”navigation”>
    <div class=”nav-previous”><?php previous_post_link( ‘%link’, ‘<span class=”meta-nav”>’ . _x( ‘←’, ‘Previous post link’, ‘simplicius’ ) . ‘</span> %title’ ); ?></div>
    <div class=”nav-next”><?php next_post_link( ‘%link’, ‘%title <span class=”meta-nav”>’ . _x( ‘→’, ‘Next post link’, ‘simplicius’ ) . ‘</span>’ ); ?></div>
    </div>
    –>
    <div id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
    <h1 class=”entry-title”>Testimonials<?php the_title(); ?></h1>

    <b>Client Name:</b><?php echo $client_name; ?>
    <b>Location (City, State):</b><?php echo $city; ?>

    <div class=”entry-content”>

    <?php /* if ( get_the_post_thumbnail( get_the_ID(), ‘large’ ) ) :
    <div class=”post-image”>

    <?php echo get_the_post_thumbnail( get_the_ID(), ‘large’ ); ?>
    </div>
    endif; */ ?>

    <div class=”entry-content”>
    <?php the_content(); ?>
    <?php wp_link_pages( array( ‘before’ => ‘<div class=”page-link”>’ . __( ‘Pages:’, ‘simplicius’ ), ‘after’ => ‘</div>’ ) ); ?>
    </div><!– .entry-content –>

    <?php if ( get_the_author_meta( ‘description’ ) ) : // If a user has filled out their description, show a bio on their entries ?>
    <div id=”entry-author-info”>
    <div id=”author-avatar”>
    <?php echo get_avatar( get_the_author_meta( ‘user_email’ ), apply_filters( ‘simplicius_author_bio_avatar_size’, 60 ) ); ?>
    </div><!– #author-avatar –>

    <div id=”author-description”>
    <h2><?php printf( esc_attr__( ‘About %s’, ‘simplicius’ ), get_the_author() ); ?></h2>

    <?php the_author_meta( ‘description’ ); ?>
    <div id=”author-link”>
    “>
    <?php printf( __( ‘View all posts by %s <span class=”meta-nav”>→</span>’, ‘simplicius’ ), get_the_author() ); ?>

    </div><!– #author-link –>
    </div><!– #author-description –>
    </div><!– #entry-author-info –>
    <?php endif; ?>

    <div class=”rule”></div>
    <div id=”post-infobox”>
    <div class=”entry-meta”>
    <?php simplicius_posted_on(); ?>
    </div><!– .entry-meta –>

    <div class=”entry-utility”>
    <?php simplicius_posted_in(); ?>
    <?php edit_post_link( __( ‘Edit’, ‘simplicius’ ), ‘<span class=”edit-link”>’, ‘</span>’ ); ?>
    </div><!– .entry-utility –>
    </div><!– /#post-infobox –>
    <div class=”rule”></div>
    </div><!– #post-## –>
    <!–
    <div id=”nav-below” class=”navigation”>
    <div class=”nav-previous”><?php previous_post_link( ‘%link’, ‘<span class=”meta-nav”>’ . _x( ‘←’, ‘Previous post link’, ‘simplicius’ ) . ‘</span> %title’ ); ?></div>
    <div class=”nav-next”><?php next_post_link( ‘%link’, ‘%title <span class=”meta-nav”>’ . _x( ‘→’, ‘Next post link’, ‘simplicius’ ) . ‘</span>’ ); ?></div>
    </div>
    –>

    <?php comments_template( ”, true ); ?>

    <?php endwhile; // end of the loop. ?>

    </div><!– #content –>
    </div><!– #container –>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>
    ———————————————————————–
    PLUGIN’S SHORTCODE-TESTIMONIAL.PHP (TEMPLATE FOR DISPLAYING ALL SINGLE POSTS)
    ———————————————————————–

    <?php
    /**
    * The Template for displaying all single posts.
    *
    * @package WordPress
    * @subpackage Twenty_Ten
    * @since Twenty Ten 1.0
    */
    $custom_fields = get_post_custom($post->ID);
    $client_name = $custom_fields[“name”][0];
    $Location (City, State) = $custom_fields[“Location (City, State)”][0];

    get_header(); ?>
    <div id=”container”>
    <div id=”main”>

    <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
    <!–
    <div id=”nav-above” class=”navigation”>
    <div class=”nav-previous”><?php previous_post_link( ‘%link’, ‘<span class=”meta-nav”>’ . _x( ‘←’, ‘Previous post link’, ‘simplicius’ ) . ‘</span> %title’ ); ?></div>
    <div class=”nav-next”><?php next_post_link( ‘%link’, ‘%title <span class=”meta-nav”>’ . _x( ‘→’, ‘Next post link’, ‘simplicius’ ) . ‘</span>’ ); ?></div>
    </div>
    –>
    <div id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
    <h1 class=”entry-title”>Testimonials<?php the_title(); ?></h1>

    <b>Client Name:</b><?php echo $client_name; ?>
    <b>Location (City, State):</b><?php echo $city; ?>

    <div class=”entry-content”>

    <?php /* if ( get_the_post_thumbnail( get_the_ID(), ‘large’ ) ) :
    <div class=”post-image”>

    <?php echo get_the_post_thumbnail( get_the_ID(), ‘large’ ); ?>
    </div>
    endif; */ ?>

    <div class=”entry-content”>
    <?php the_content(); ?>
    <?php wp_link_pages( array( ‘before’ => ‘<div class=”page-link”>’ . __( ‘Pages:’, ‘simplicius’ ), ‘after’ => ‘</div>’ ) ); ?>
    </div><!– .entry-content –>

    <?php if ( get_the_author_meta( ‘description’ ) ) : // If a user has filled out their description, show a bio on their entries ?>
    <div id=”entry-author-info”>
    <div id=”author-avatar”>
    <?php echo get_avatar( get_the_author_meta( ‘user_email’ ), apply_filters( ‘simplicius_author_bio_avatar_size’, 60 ) ); ?>
    </div><!– #author-avatar –>

    <div id=”author-description”>
    <h2><?php printf( esc_attr__( ‘About %s’, ‘simplicius’ ), get_the_author() ); ?></h2>

    <?php the_author_meta( ‘description’ ); ?>
    <div id=”author-link”>
    “>
    <?php printf( __( ‘View all posts by %s <span class=”meta-nav”>→</span>’, ‘simplicius’ ), get_the_author() ); ?>

    </div><!– #author-link –>
    </div><!– #author-description –>
    </div><!– #entry-author-info –>
    <?php endif; ?>

    <div class=”rule”></div>
    <div id=”post-infobox”>
    <div class=”entry-meta”>
    <?php simplicius_posted_on(); ?>
    </div><!– .entry-meta –>

    <div class=”entry-utility”>
    <?php simplicius_posted_in(); ?>
    <?php edit_post_link( __( ‘Edit’, ‘simplicius’ ), ‘<span class=”edit-link”>’, ‘</span>’ ); ?>
    </div><!– .entry-utility –>
    </div><!– /#post-infobox –>
    <div class=”rule”></div>
    </div><!– #post-## –>
    <!–
    <div id=”nav-below” class=”navigation”>
    <div class=”nav-previous”><?php previous_post_link( ‘%link’, ‘<span class=”meta-nav”>’ . _x( ‘←’, ‘Previous post link’, ‘simplicius’ ) . ‘</span> %title’ ); ?></div>
    <div class=”nav-next”><?php next_post_link( ‘%link’, ‘%title <span class=”meta-nav”>’ . _x( ‘→’, ‘Next post link’, ‘simplicius’ ) . ‘</span>’ ); ?></div>
    </div>
    –>

    <?php comments_template( ”, true ); ?>

    <?php endwhile; // end of the loop. ?>

    </div><!– #content –>
    </div><!– #container –>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

  • The topic ‘How to show all custom post testimonials on my testimonials page’ is closed to new replies.