• Resolved Charles Grimes

    (@cagrimes)


    I created a custom field, “City” and named as “city_name”. When I add the [strong form] code, the form displays all fields including city. However when I view the testimonials page, city is not displayed. Checking the testimonials in wp admin pages, the city_name field is present and the city is populated.

    Code:

    [strong per_page="5" nav="before,after" title]
    [client]
    [field name="client_name"]
    [field name="city_name" class="city"]
    [/client]
     [/strong]

    What am I missing?

    Thanks! / Charles

    https://ww.wp.xz.cn/plugins/strong-testimonials/

Viewing 9 replies - 16 through 24 (of 24 total)
  • Plugin Contributor Chris Dillon

    (@cdillon27)

    Sorry, I should have tested it first.

    Try this:
    (your code was missing a closing </div> so double-check that)

    <div class="strong-container <?php echo $container_class_list; ?>">
    	<div class="strong-content <?php echo $content_class_list; ?>">
    		<?php while ( $query->have_posts() ) : $query->the_post(); ?>
    		<div class="<?php echo $post_class_list; ?> post-<?php echo the_ID(); ?>">
    			<div class="inner">
    				<h3 class="heading" style="font-style: strong; italic;"><?php the_title(); ?></h3>
    				<?php /* The Content Block */ ?>
    				<div class="content">
    					<?php /* Thumbnail */ ?>
    					<?php /* Removed in favor of if/then/else below */ ?>
    					<?php /* See original testimonials.php in plugins */ ?>
    
    					<?php if ( has_post_thumbnail() ) : ?>
    					<div class="photo"><?php the_post_thumbnail(); ?></div>
    					<?php else : ?>
    					<?php echo get_avatar( wpmtst_get_field( 'email' ), 150, '' ); ?>
    					<?php endif; ?>
    					<?php /* Sets review exerpt to 200 characters */ ?>
    					<?php wpmtst_field( 'truncated', array( 'char_limit' => 200 ) ); ?>
    				</div>
    				<div class="readmore"><a href="<?php echo get_permalink(); ?>">Read more</a></div>
    				<?php /* The Client Block */ ?>
    				<div class="client">
    					<?php /* Custom Fields */ ?>
    					<div class="name"><?php wpmtst_field( 'client_name' ); ?></div>
    					<div class="company"><a href="<?php wpmtst_field( 'company_website' ); ?>" target="_blank"><?php wpmtst_field( 'company_name'); ?></a></div>
    					<div class="city"><?php wpmtst_field( 'city_name' ); ?></div>
    				</div>
    				<div class="clear"></div>
    			</div>
    		</div>
    		<?php endwhile; ?>
    	</div>
    </div>

    Add this to your child stylesheet:

    /*
    The theme gives <h3> a weight of 500. Try 700 for traditional bold.
    The plugin adds the quote symbol as a background image.
    */
    .strong-container .testimonial .heading {
    	font-style: italic;
    	/* font-weight: 700; */
    	background: none;
    	padding-left: 0;
    }

    And now the shortcode only needs to be:

    [strong per_page="5" nav="before,after"]

    because the template handles the rest.

    Edit: Removed get_the_ID() from has_post_thumbnail().

    Thread Starter Charles Grimes

    (@cagrimes)

    Man…I counted the open/close a half dozen times and still missed one.

    Okay this part of the code produces the avatar, but not featured image which is the site logo (and, honest, it is set as featured image)

    <div class="content">
    					<?php /* Thumbnail */ ?>
    					<?php /* Removed in favor of if/then/else below */ ?>
    					<?php /* See original testimonials.php in plugins */ ?>
    
    					<?php if ( has_post_thumbnail() ) : ?>
    					<div class="photo"><?php the_post_thumbnail(); ?></div>
    					<?php else : ?>
    					<?php echo get_avatar( wpmtst_get_field( 'email' ), 150, '' ); ?>
    					<?php endif; ?>
    					<?php /* Sets review exerpt to 200 characters */ ?>
    					<?php wpmtst_field( 'truncated', array( 'char_limit' => 200 ) ); ?>
    				</div>

    still missing something… I read the stuff on featured images, but nothing seems to help

    Plugin Contributor Chris Dillon

    (@cdillon27)

    I don’t understand. Tell me in simple language what you want for the photo.

    Thread Starter Charles Grimes

    (@cagrimes)

    Chris

    Now I see…

    I selected a featured image on the Reviews/Testimonials page (the one with the excerpts) which seemed logical to me.

    Playing around for a few minutes, I need to put the featured image on the page of the full review, then it shows up in the excerpt (good), but appears at the top of the post in a very huge size (bad), but I think that’s a css issue and I’ll work on that.

    I do see that if I put an image in the post (i.e., “insert media”) the image appears in the full post page, but not as a thumbnail in the excerpts page. I have to put the image in the featured image spot, but it shows up large, so again, a CSS issue.

    As I suspected, operator error…
    http://ec2-52-6-192-97.compute-1.amazonaws.com/dianes-reviews/

    Plugin Contributor Chris Dillon

    (@cdillon27)

    Me too. In testimonials.php, try

    the_post_thumbnail( 'thumbnail' )

    or

    the_post_thumbnail( array( 150, 150 ) )

    A big part of the learning curve is learning to think “Is there a WordPress function or option for that?”

    Thread Starter Charles Grimes

    (@cagrimes)

    CSS Hero is awesome…I used that to globally (and dynamically) change the featured image on the full text testimonial page.
    I also dynamically modified the responsive layout (text and image) for smartphone / tablet (perfect in portrait, not correct in landscape so back to the drawing board.
    Anyway, a great plugin for quickly and dynamically, modifying css.

    I’ll give the code change a try… getting there.

    Plugin Contributor Chris Dillon

    (@cdillon27)

    When I said “Me too” earlier, I meant my operator error, not yours 🙂

    It’s looking good. The full post uses the single.php template. You can copy that from the parent to your child theme and perform similar customizations as you did for the testimonials page. If you want your customizations to only apply to testimonials, not regular posts, name the file single-wpm-testimonial.php.

    Thread Starter Charles Grimes

    (@cagrimes)

    haha…no problem…I make enough for both.

    Thanks again… I’m slowly delving into the guts of WordPress …

    Thread Starter Charles Grimes

    (@cagrimes)

    and I will probably do that as well…

Viewing 9 replies - 16 through 24 (of 24 total)

The topic ‘Custom field name not appearing in (strong) testimonial’ is closed to new replies.