WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Bugfix for Dynamic Height

[Resolved] Bugfix for Dynamic Height

  • 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/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Hal Gatewood
    Participant

    @halgatewood

    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.

    jcpenrose83
    Member

    @jcpenrose83

    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.

    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!

    Plugin Author Hal Gatewood
    Participant

    @halgatewood

    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

    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!

    colourstone
    Participant

    @colourstone

    Thank you jonkratz!

    That fixed my issue!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] Bugfix for Dynamic Height’ is closed to new replies.