Good!
Every theme is different. With the TwentyThirteen theme, we need to copy two files in the directory /wp-content/themes/twentythirteen
:
single.php
-> single-wpm-testimonial.php
content.php
-> content-testimonial.php
To do that with most FTP programs like CoffeeCup or SmartFTP, you need to download it, rename it, and upload the renamed copy.
WordPress will find the single-wpm-testimonial.php
template file automagically when it displays a testimonial.
You can edit those files either in admin > Appearance > Editor or on your computer before you upload them using a program like Notepad++.
In single-wpm-testimonial.php
, change
<?php get_template_part( 'content', get_post_format() ); ?>
to
<?php get_template_part( 'content', 'testimonial' ); ?>
In content-testimonial.php
, add fields like
wpmtst_field( 'client_name' );
after the content( ... )
so the whole <div>
looks like this:
<div class="entry-content">
<?php
/* translators: %s: Name of current post */
the_content( sprintf(
__( 'Continue reading %s <span class="meta-nav">→</span>', 'twentythirteen' ),
the_title( '<span class="screen-reader-text">', '</span>', false )
) );
?>
<p class="client">
<div class="name"><?php wpmtst_field( 'client_name' ); ?></div>
<div class="company"><?php wpmtst_field( 'company_name' ); ?></div>
</p>
<?php
wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) );
?>
</div><!-- .entry-content -->
and obviously use whatever your custom field names are.