Support » Plugin: The Events Calendar Shortcode & Block » thumb link dissappears when adding thumbwidth & thumbheight

  • Resolved Jose Luis Cruz

    (@joseluiscruz)


    The anchor tags surrounding the thumbnail img tag, that links to the event, dissappears completely when using the attributes thumbwidth and thumbheight. This feels like a bug.

    This shortcode shows the thumbnail with link:
    `
    [ecs-list-events limit=’2′ thumb=’true’]
    `

    This does does not:
    `
    [ecs-list-events limit=’2′ thumb=’true’ thumbwidth=’170′ thumbheight=’170′]
    `

    thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Brian Hogg

    (@brianhogg)

    Hi Jose,

    I agree this is a bit odd, but unfortunately it was how the plugin was designed before I took over support for it. Adding the link could mess up formatting for those who expect the link not to be there.

    There is now a ecs_event_thumbnail filter you could use to add the link. For example something like this could be added to a functional plugin or in your theme’s functions.php file:

    function ecs_add_link_to_thumbnail( $output, $atts, $post ) {
        return '<a href="' . tribe_get_event_link() . '">' . get_the_post_thumbnail( get_the_ID(), array( $atts['thumbwidth'], $atts['thumbheight'] ) ) . '</a>';
    }
    add_filter( 'ecs_event_thumbnail', 'ecs_add_link_to_thumbnail', 10, 3 );
    

    Hope that helps. If not let me know!

    Hi Brian, many thanks for your help,

    I’ve been taking a good look at the code of the plugin and I like it’s clear enough and that you added those filters in key places, so it’s easy to accomplish several things I needed.

    I resorted to using the filter ecs_event_thumbnail_size to avoid that behaviour when using the arguments in question. Your code is another possibility.

    And the ecs_event_*_tag_start and ecs_event_*_tag_end where useful to encircle multiple fields inside a div to aid a specific styling wasn’t possible before.

    I want to ask you would you be open to sporadic collaboration on your plugin? I may have some ideas on how to improve that area in order to achieve more versatility, like adding an argument to control the ouput of the thumbnail link. Backwards compatibility can be respected too as you say.

    But I suppose the plugin is not in Github, right?

    best regards

    Plugin Author Brian Hogg

    (@brianhogg)

    The plugin is not currently on github but certainly if you have suggestions for improvements just let me know!

    Great! Will do

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘thumb link dissappears when adding thumbwidth & thumbheight’ is closed to new replies.