Add company name to page template
-
Hi,
I’ve made my own testimonial.php and that renders the output-templates useless. I’ve tried many options to echo the input from these custom field:
tbtestimonial_company
<?php echo "Organisatie: ".get_post_meta($post->ID,'tbtestimonial_company', 1); ?>
also tried:
<?php echo "Organisatie: ".get_post_meta($post->ID,'tbtestimonial_company', true); ?>
<?php the_meta(); ?>
does output:
tbtestimonial_company: *******************
Do you have a suggestion for me?
My code is:
<?php /** * The Template for displaying a single Testimonial. * * @package WordPress * @subpackage Twenty_Ten * @since Twenty Ten 1.0 */ get_header(); ?> <?php get_sidebar('left'); ?> <div id="container"> <div id="content" role="main"> <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it. the_post_thumbnail(article_large); } ?> <h1 class="entry-title"><?php the_title(); ?></h1> <div class="entry-content"> <?php the_content(__( 'Read More', 'twentyten' ) ); ?> <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?> </div><!-- .entry-content --> </div><!-- #post-## --> <?php echo '<p>' . get_post_meta($post->ID, 'tbtestimonial_company', true) . '</p>'; ?> <?php endwhile; // end of the loop. ?> <div style="width:100%; text-align:center;"><a href="#bttop">Back to top ↑</a></div> </div><!-- #content --> </div><!-- #container --> <?php get_sidebar(); ?> <?php get_footer(); ?>
and the part that is not showing:
<?php echo '<p>' . get_post_meta($post->ID, 'tbtestimonial_company', true) . '</p>'; ?>
How do I make it work? ??
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Add company name to page template’ is closed to new replies.