WordPress.org

Ready to get started?Download WordPress

Forums

HMS Testimonials
[resolved] Wrap Image & text with HTML (8 posts)

  1. juraganpsd
    Member
    Posted 8 months ago #

    Hello,
    I'm using this great plugins, and i really like it. Simply the best Testimonial plugin for WordPress.
    However, i want to wrap the displayed imagae & testimonial with another HTML, let's say a Div wrap. It would be like this:

    <div id="photo"><img class="image" src="url"></div>
    <div id="details">
    <div class="author">Client Name</div>
    <div class="testimonial">Lorem ipsum dolor sit amet</div>
    <div class="date">October 16, 2013</div>
    </div>

    Which file do i have to edit?
    Thanks!

    http://wordpress.org/plugins/hms-testimonials/

  2. Jeff K
    Member
    Plugin Author

    Posted 8 months ago #

    Hey juraganpsd,

    admin.php is the file and the code is at the bottom.

    Anytime you update the plugin your changed will be lost.

  3. juraganpsd
    Member
    Posted 8 months ago #

    Hello Jeff K,

    Got it, i thought it was on the other file. Great.

    Thanks for your quick response Jeff, Cheers!

  4. Easo
    Member
    Posted 7 months ago #

    Hello,
    this plugin is working very nicely, however I can't find a way to style it.

    I need to wrap together the "author" and the "testimonial" inside a div.
    I have looked at the admin.php file but I'm a beginner and I don't know where to find the code to be changed.

    Any help, please? :)

  5. Jeff K
    Member
    Plugin Author

    Posted 7 months ago #

    Hey Easo,

    All the fields for each testimonial are wrapped inside a container div with a class of "hms-testimonial-container"

  6. Easo
    Member
    Posted 7 months ago #

    Hi Jeff,
    thanks for the help.
    However I wanted to have the author and testimonial in a div separated from the image, so I need to create a new div inside "hms-testimonial-container".

    Where can I create that new div?

    Thanks in advanced!

  7. Jeff K
    Member
    Plugin Author

    Posted 7 months ago #

    You will have to modify the template method in admin.php. It's the last method I believe.

    Just beware that next time you update the plugin you will lose your changes.

  8. Easo
    Member
    Posted 7 months ago #

    I've been looking at the admin.php file, but I can't figure out where to place my div.
    I know very little of php at the moment.
    My guess is that I should place somewhere inside this code?

    [ Moderator note: please wrap code in backticks or use the code button. ]

    $container = HMS_Testimonials::getInstance()->options['testimonial_container'];
    
    					if ($container == 'div')
    						$builder .= '<div class="testimonial">'.apply_filters('hms_testimonials_system_testimonial', $testimonial['testimonial'], $testimonial).'</div>';
    					elseif ($container == 'blockquote')
    						$builder .= '
    <blockquote>'.apply_filters('hms_testimonials_system_testimonial', $testimonial['testimonial'], $testimonial).'</blockquote>
    ';
    				break;
    				case 'system_source':
    					$testimonial['name'] = $purifier->purify($testimonial['name']);
    					$builder .= '<div class="author">'.apply_filters('hms_testimonials_system_source', nl2br($testimonial['name']), $testimonial).'</div>';
    				break;
    				case 'system_date':
    					$date = strtotime(strip_tags($testimonial['testimonial_date']));
    					$show_date = date(HMS_Testimonials::getInstance()->options['date_format'], $date);
    					$builder .= '<div class="date">'.apply_filters('hms_testimonials_system_date', (($testimonial['testimonial_date'] == '0000-00-00 00:00:00') ? '' : $show_date), $testimonial).'</div>';
    				break;
    				case 'system_url':
    					$url = '';

    But I have done some tries and it didn't work.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.