• Resolved tanjadebie

    (@tanjadebie)


    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 fields:

    tbtestimonial_company_url
    tbtestimonial_company

    <?php echo get_post_meta( $post->ID, ‘tbtestimonial_company_url’, 1 ); ?>
    <?php echo “Organisatie: “.get_post_meta($post->ID,’tbtestimonial_company’, 1); ?>

    also tried TRUE.

    <?php the_meta(); ?>
    does output:

    tbtestimonial_company_url: https://www**************
    tbtestimonial_company: *******************

    Do you have a suggestion for me?

    thanks (and best wishes)
    Tanja

    https://www.ads-software.com/extend/plugins/tb-testimonials/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Travis Ballard

    (@ansimation)

    My guess is that $post->ID is probably null so it’s not working correctly. It should be within the loop that you’re fwtching the meta. Otherwise you will need to bring $post into the current scope in order to access it. Can you pastebin your template?

    Plugin Author Travis Ballard

    (@ansimation)

    Marking this as resolved. If it isn’t, please reopen it.

    I am having the same problem, here is my code from testimonial.php:

    <?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 &uarr;</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? ??

    Ok I’ve started a new thread about this since this one is already marked as resolved and can be overlooked ??

    New thread is here.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add company name and url to page template’ is closed to new replies.