Displaying person's position in the Testimonial carousel

Previously, in this post, I tried to display the testimonial person's title under their name in the Testimonial carousel on the homepage. The workaround was to add it into the post title using html markup (ex. Testimonial Giver <br><small class="hc_testimonials_position">Patient</small>). Externally, this displays fine in most cases but, it looks horrible from the backend when viewing the list of posts. The one external case when it looks bad is in a breadcrumb listing. Because it's part of the post title, it stacks under when listed in the breadcrumb.
To remedy this, I used the Custom Fields option to create a subtitle. The subtitle now shows in place of the previous workaround, except in the Testimonial carousel. I found what I think needs to change, but I'm having difficulty getting the PHP right to display it.

The original in index-testimonials_two.php:
     <div class="hc_testimonials_position"><?php echo $meta_author_designation; ?></div>

I tried the following in a child theme version of index-testimonials_two.php:

$meta_author_designation =  get_post_meta( get_the_ID(),'subtitle', true );

But it's not displaying the subtitle. I feel like I'm close, but missing something (and likely obvious).

FYI, the code for the subtitle I modified in single.php is:


  • Priyanshu,

    That post refers to a new feature added to Our Team, a description of staff. I am referring to the testimonial posts that appear in the Testimonial carousel, which comes from patients/clients or professionals. The Our Team info does not help as I'm not trying to put links in the description. Essentially, I am looking to create:

    Testimonial body recommending the services etc etc

    Person's Name (post title)
    Person's Title (post subtitle)

    Atm, the only way to display the subtitle portion is to drop HTML into the post title. This creates difficulties when the testimonials list in various areas, primarily in the breadcrumbs.
  • Hi

    Basically you also want to show testimonials on the other templates as well. Is your site live, if possible share your site url I want to see how you are showing testimonials in the menu.

  • edited August 2016
    The site is not live and in localhost testing.

    This image is an example of how I would like it to look, but this is using the method of placing HTML in the post title (ex. Testimonial Giver <br><small class="hc_testimonials_position">Patient</small> )
    In this testimonial example, the "More" links to the full testimonial post. The full testimonial post displays as shown in the OP first image.

    I am trying to achieve displaying in the carousel, as the image in this comment shows, without using HTML in the post title because it creates display issues, as seen in the breadcrumb image in the OP.

    I was trying to piece together some code I found about subtitles, but it's not displaying the subtitle. I'm missing something, but not sure what.

    FYI, the subtitle code does display the subtitle when viewing the testimonial post. So, the issue is getting it to display in the testimonial carousel.
  • I found what I needed to change located in a different file, wbr-testimonial-widget.php.

    <h4 class="hc_testimonials_title"><?php the_title(); ?></h4>
    <!--<div class="hc_testimonials_position"></div>-->
    I changed the hc_testimonials_position div to:
    <div class="hc_testimonials_position"><?php echo get_post_meta( get_the_ID(), 'subtitle' , true); ?></div>

    Unfortunately, I could not do this by creating a copy of wbr-testimonial-widget.php in a child theme and editing the copy. I could only get the changes to take by editing the original file.
  • Hi

    Thats the widget file so you need to upload  complete functions folder in to the child theme folder and then edit the widget file.

    In fact in the next release we are going to give a support for Custom Field for adding designation. Either you can wait or proceed by making changes in child theme.

  • I tried placing wbr-testimonial-widget.php in /functions/widget, in /functions, and in the root of my child theme folder but no changes are taken from the file.
  • It looks like the recent addition of "designation" did what I was looking for in the testimonials.

    You can close this.

    Thank you.
  • Hi

    If you love this theme and support than kindly share your feedback here at https://wordpress.org/support/theme/health-center-lite/reviews/?filter=5

This discussion has been closed.