• Resolved downhomeme

    (@downhomeme)


    Hello all,

    Please see this screenshot: https://thefullquiver.com/wp-content/uploads/2017/03/screenshot6.jpg

    As you can see, I would like to make the link in the event excerpt/description on the home page clickable. I would like to do this for all the links in the event excerpt in the list format (this list can be found on my home page and on the “Events” page – here is the website, thefullquiver.com).

    Does anybody know how to accomplish this? Any help provided would be greatly appreciated.

    Thank you in advance,

    Grace

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    you can try something like <a href="#_EVENTURL"> #_EVENTEXCERPT </a>

    Thread Starter downhomeme

    (@downhomeme)

    Thank you for your response.
    I tried something similar to what you suggested <a href="#_EVENTURL">#_EVENTEXCERPT{5,...}</a> and it made the whole event excerpt link to the actual event page. I would like it to link to the external link in the description (in this case, it was a facebook page). See this screenshot: https://thefullquiver.com/wp-content/uploads/2017/03/screenshot7.jpg
    Is there a way to accomplish this?

    Thank you for your time.

    How did you add the link to the Facebook page?

    Thread Starter downhomeme

    (@downhomeme)

    I added the links to the Facebook pages in the event descriptions. See these links:
    https://thefullquiver.com/events/collinsville-bible-baptist
    https://thefullquiver.com/events/spring-creek-baptist-church
    …Look underneath the address for the event.

    Thank you for your help!

    Ok, I see what’s happening now. By default, the #_EVENTEXCERPT placeholder removes HTML code when used with a number, which is why your link isn’t appearing.

    If you use the placeholder without a number the link should be clickable.

    Thread Starter downhomeme

    (@downhomeme)

    Thank you for your help. I tried what you suggested and I got this:
    https://thefullquiver.com/wp-content/uploads/2017/03/screenshot8.jpg
    There are extra gaps that I don’t want and that didn’t show up when I used #_EVENTEXCERPT{5,...}. I also really like the limit on words that show when using that code snippet I just mentioned. So there’s no way to get the HTML code of the hyperlink with a number? Please advise.

    Thank you so much!

    The gaps are appearing because the HTML code is being used, so the line breaks in your event description are being included in the excerpt.

    If you want to choose which HTML code is used in excerpts you’d need to create your own custom excerpts placeholder.

    Thread Starter downhomeme

    (@downhomeme)

    Ok. Thank you. Regarding “custom excerpts placeholder” should I follow along the lines of something like this? >> https://www.mightyminnow.com/2013/08/custom-excerpt-placeholder-for-events-manager/

    I haven’t tried that code, but something like that should work.

    • This reply was modified 7 years, 8 months ago by caimin_nwl.
    Thread Starter downhomeme

    (@downhomeme)

    Ok, great! What code would you use to do what I’m envisioning? Thank you for all your help @caimin_nwl!

    I’d probably use that same code ??

    Thread Starter downhomeme

    (@downhomeme)

    I used the same code listed on this website except changing it to not strip the HTML

    /** Create custom #_CUSTOMEXCERPT placeholder for Events Manager */
    function my_em_styles_placeholders( $replace, $EM_Event, $result ) {
    	global $wp_query, $wp_rewrite;
     
    	// Whether or not to strip HTML, if not be careful with the $length as you can cut off in the middle of tags
    	$strip_HTML = false;
     
    	// Max length of the excerpt (characters)
    	$length = 120;
     
    	// String to append to excerpt, if it is longer than the max length
    	$after = "…";
     
    	switch( $result ) {
    		case '#_CUSTOMEXCERPT': // name of the placeholder
    			// Get standard excerpt output
    			$replace = $EM_Event->output( "#_EVENTEXCERPT" );
     
    			// Strip all HTML
    			if ( $strip_HTML ) {
    				$replace = strip_tags( $replace );
    			}
     
    			// Only modify the excerpt if it exceeds the maximum allowed length
    			if ( strlen( $replace ) > $length ) {
    				$replace = substr( $replace, 0, $length );
    				$replace .= $after;
    			}
     
    			// Balance tags just in case
    			$replace = force_balance_tags( $replace );
     
    			break; // end the case
    	}
     
    	return $replace ; //output the placeholder
    }
    add_filter( 'em_event_output_placeholder','my_em_styles_placeholders', 1, 3 );

    I applied #_CUSTOMEXCERPT to my events list view. Now I have big gaps AND the links still aren’t clickable – see here. What am I doing wrong? Any help is greatly appreciated.

    Thank you!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Link in event excerpt not clickable in list format’ is closed to new replies.