WordPress.org

Ready to get started?Download WordPress

Forums

TBTestimonials
[resolved] Feature request: Use image instead of gravatar (2 posts)

  1. sixtyseven
    Member
    Posted 1 year ago #

    As the title says: I'd like to see an option to use an image instead of the gravatar. Others than this: Nice work, love the plugin!

    http://wordpress.org/extend/plugins/tb-testimonials/

  2. Travis Ballard
    Member
    Plugin Author

    Posted 1 year ago #

    This is resolved, yes? same way you added the testimonial date in your othe rpost but instead of returning the date, you return get_the_post_thumbnail() or whatever instead.

    Example:

    /**
    * add custom template tags to tbtestimonials plugin
    *
    * @param mixed $t - twig instance
    */
    function add_tags_to_tbt( $t ){
        $t->addGlobal( 'image', call_user_func( 'tbt_featured_image_tag' ) );
    }
    
    /**
    * callback for image template tag in tbtestimonials
    *
    */
    function tbt_featured_image_tag()
    {
        if( has_post_thumbnail() )
            return get_the_post_thumbnail();
    
        return false;
    }
    
    # hook in
    add_action( 'tbt_template_functions', 'add_tags_to_tbt' );

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.