• Resolved briankross

    (@briankross)


    Hello,

    A testimonial read more link from an automatic excerpt length goes to a page with no author information. The display has a title, post date, text body, and a link pointing to the next or previous entry.

    Is there a way to display author information on these pages? It’s not a view, it’s the endpoint of the read more link.

    • This topic was modified 8 years, 2 months ago by briankross.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Chris Dillon

    (@cdillon27)

    That is your theme’s single post template. It is not aware of the testimonial custom fields. Every theme is different and I have not found a universal way to display it like the view does.

    The solution is to make a single testimonial template by copying the single post template. It requires copying file(s) and modifying code. I can walk you through it if you’re interested. Or tell me where to find your theme and I may be able to get you most if not all the way there.

    Thread Starter briankross

    (@briankross)

    Hi Chris, thanks so much. I’m using WooCommerce. I have their base theme of “Storefront” (free), and child theme of “Homestore” (paid). This complicates things a bit since I can’t edit their child theme directly, and use their plugin called “Theme Customisations” to make customizations to top level template files, along with css, php, jQuery, etc.

    That said, I think I need to edit the base theme’s “single.php” file but I’ll do some testing. I’m comfortable editing php code with a walk through, but I wouldn’t call myself a programmer. I don’t know what’s needed exactly to display the author info, or this will affect anything else unexpectedly like blog posts or comments.

    This is a customization issue, not a plugin issue so you certainly don’t need to help with this. I understand if you don’t have time, and would be extremely grateful if you do. I’m always up for learning something new.

    Thread Starter briankross

    (@briankross)

    Okay, that’s the right template. This is what I’m editing from the base theme:

    /wp-content/plugins/theme-customisations/custom/templates/single.php

    • This reply was modified 8 years, 2 months ago by briankross. Reason: cleanup work
    Thread Starter briankross

    (@briankross)

    When viewing single blog post entries I can see my simple html additions to “single.php”.

    Plugin Contributor Chris Dillon

    (@cdillon27)

    Thanks for acknowledging it’s a customization issue. I’m glad to help, I always learn something, and it gives me ideas on building a better plugin. It’s all good.

    Storefront and their Customisations plugins actually make it easier without the need for creating a new template, though you can if you want.

    For example, add this to the Customisations plugin’s custom/functions.php:

    /**
     * Adding testimonial custom fields to single testimonial posts.
     * 
     * For Strong Testimonials plugin.
     */
    function child_testimonial_fields() {
    	if ( is_singular( array( 'wpm-testimonial' ) ) ) : ?>
    		
    		<div class="testimonial-name"><?php wpmtst_field( 'client_name' ); ?></div>
    		<div class="testimonial-company"><?php wpmtst_field( 'company_name' ); ?></div>
    		
    	<?php endif;
    }
    add_action( 'storefront_single_post', 'child_testimonial_fields', 40 );

    Use your custom field names if they are different. We can change the position and add CSS to make it look as you wish.

    Thread Starter briankross

    (@briankross)

    Thanks for acknowledging it’s a customization issue.

    No worries, I didn’t realize this until you mentioned it.

    Thank you for your help, I don’t see the field values output on the single post however.

    Thread Starter briankross

    (@briankross)

    Wait, I see it! My mistake. Thank you, I’ll play with CSS a bit. You rock.

    Thread Starter briankross

    (@briankross)

    This is what I’ll start with:

    .testimonial-name {
    	margin-top: 1em;
            font-weight: bold;
    	text-align: right;
    }
    
    .testimonial-company {
    	font-weight: bold;
    	text-align: right;
    	line-height: .5;
    }
    • This reply was modified 8 years, 2 months ago by briankross. Reason: fixed wonky rendering
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘About the testimonial read more link’ is closed to new replies.