WordPress.org

Ready to get started?Download WordPress

Forums

Testimonial Rotator
[resolved] Bugfix for Dynamic Height (7 posts)

  1. jonkratz
    Member
    Posted 6 months ago #

    This is a great plugin—well done. I began using it a couple of months ago in a site I'm developing. The project got postponed and upon resuming it, I realized there was a difference in the local version of the website and the remote. The remote had been updated to the more recent version of the plugin, the the local hadn't.

    The difference was that there was no longer dynamic height adjustment of the container div. After looking at the updates, I realized that you'd updated to Cycle2. So I went on his website and looked through the API and realized that the issue is with one "data-" metatag on the container div.

    Currently, "data-cycletwo-auto-height" is set to "calc" which calculates and sets the container height to the tallest containing slide. Previously, the plugin had the behavior of setting that to "container" (probably the original Cycle's default behavior). Anyways, I recognize the need for you to make a judgement call here — I resolved it for myself on line 413 of testimonial-rotator.php (but will now have to instruct client to not update).

    So I updated: data-cycletwo-auto-height=\"calc\" to now be data-cycletwo-auto-height=\"container\" on line 413.

    My suggestion is perhaps to make this a setting per testimonial slider. I don't know the amount of work that might take, so I understand you not doing it either.

    Either way, thanks for making such a great plugin. Quite happy with it. You can see it in action at http://watershed.ccmservers.com for the time being.

    http://wordpress.org/plugins/testimonial-rotator/

  2. Hal Gatewood
    Member
    Plugin Author

    Posted 6 months ago #

    Good catch, I can add a filter that would allow you to change it permanently in your theme. It's on my list and will get added in the next release.

  3. jcpenrose83
    Member
    Posted 2 months ago #

    Was this filter ever implemented so the height adjusts dynamically for rotators & widgets? It'd be a useful feature for a site I'm working on.

  4. jonkratz
    Member
    Posted 2 months ago #

    Hi jcpenrose83, I was just going to reply that I don't know about the filter but then I saw in the change log that it looks like the developer added it yesterday!

    1.4
    Use shortcode to display testimonials from all rotators by not passing in an 'id' attribute
    Completed preparation for translation, wrapped all text in __()
    Two new filters for the 'supports' section of the register_post_type: testimonial_rotator_supports and testimonial_rotator_testimonial_supports
    Two new filters for auto-height 'calc': testimonial_rotator_calc and testimonial_rotator_widget_fx

    Thanks for the update!

  5. Hal Gatewood
    Member
    Plugin Author

    Posted 2 months ago #

    Yes I did. Unfortunately I typo'd in the readme file. The two filters are:

    testimonial_rotator_calc
    testimonial_rotator_widget_calc

    To set the height to 400px use this:

    function testimonial_rotator_set_height( $args ) { return 400; }
    add_filter( 'testimonial_rotator_calc', 'testimonial_rotator_set_height' );
    add_filter( 'testimonial_rotator_widget_calc', 'testimonial_rotator_set_height' );

    For more information see the 'auto-height' section of this page: http://jquery.malsup.com/cycle2/api/#options

  6. jonkratz
    Member
    Posted 1 month ago #

    Since this thread is about dynamic height, to enable Cycle2's dynamic height which resizes for each testimonial, your addition to the functions.php file in your theme would be:

    function testimonial_rotator_set_height( $args ) { return "container"; }
    add_filter( 'testimonial_rotator_calc', 'testimonial_rotator_set_height' );
    add_filter( 'testimonial_rotator_widget_calc', 'testimonial_rotator_set_height' );

    Hope that this helps someone!

  7. colourstone
    Member
    Posted 3 weeks ago #

    Thank you jonkratz!

    That fixed my issue!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.