Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Jeroen Schmit

    (@slimndap)

    Yes, this is possible. You need to:

    1. Remove the permalink from the title and the thumbnail.
    2. Remove the tickets button
    3. Wrap the entire event in an <a> tag

    To remove the permalink from the title and thumbnail and remove the tickets button, you can change your template to:
    {{thumbnail}} {{title}} {{remark}} {{datetime}} {{location}}

    To wrap the entire event in an <a> tag you need to add some code to the functions.php of your theme:

    function wpt_add_wrapper_to_event( $html, $template, $event ) {
    	$html = '<a href="'.$event->production()->permalink().'">'.$html.'</a>';
    	return $html;
    }
    add_filter( 'wpt/event/html/context=default', 'wpt_add_wrapper_to_event', 30, 3 );
    Thread Starter vaacum

    (@vaacum)

    Thanks a lot, for your quick response.

    Oke looks like this is bundling al the links into a block. Which makes the click area wider, but it is not reacting like the div itself is clickable.

    Maybe my question was not good in the first place, sorry.

    Thanks, Rob

    Plugin Author Jeroen Schmit

    (@slimndap)

    It should be. See https://www.zaantheater.nl/ for an example.

    Thread Starter vaacum

    (@vaacum)

    Yes that’s exactly where I was looking for.

    I did put your code in a functions.php in the child Dir.

    Can I sent you a link to my test environment by email?

    Thanks

    Plugin Author Jeroen Schmit

    (@slimndap)

    You can send it to [email protected].

    Thread Starter vaacum

    (@vaacum)

    Thanks

    Plugin Author Jeroen Schmit

    (@slimndap)

    The tricks is to also leave the tickets button out of the template:

    {{thumbnail}} {{title}} {{remark}} {{datetime}} {{location}}

    You can then use another piece of code to append the tickets button to the event, outside of the link wrapper that you added earlier:

    function wpt_add_tickets_button_to_event( $html, $template, $event ) {
    	$html.= $event->tickets_html();
    	return $html;
    }
    add_filter( 'wpt/event/html/context=default', 'wpt_add_tickets_button_to_event', 40, 3 );

    You still need to add some CSS to make everything look good again.

    Thread Starter vaacum

    (@vaacum)

    Hi,

    I added the script, but it still does not function as expected.

    It combines the ‘links’ as a block, but it does make the whole div with class ‘wp_theatre_event’ clickable.

    Thanks, Rob

    Thread Starter vaacum

    (@vaacum)

    Sorry, does NOT make the whole div with class ‘wp_theatre_event’ clickable.

    Plugin Author Jeroen Schmit

    (@slimndap)

    You need to add some CSS to make the new HTML work for your website again:

    .wpt_events .wp_theatre_event>a {
        overflow: auto;
        display: block;
        margin-left: 0;
    }
    
    .wpt_events .wp_theatre_event>a>* {
        margin-left: 25%;
    }
    
    .wpt_events .wp_theatre_event>a>figure {
        margin-left: 0;
    }
    Thread Starter vaacum

    (@vaacum)

    Awesome, thanks a lot.

    Thread Starter vaacum

    (@vaacum)

    Hi,

    Would it be possible to only insert the “starting time” beneath the ticket button with an additional text field.

    To create for example, “doors open from {{time (H)}}”.

    Thanks, Rob

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘div with class wp_theatre_event clickable’ is closed to new replies.