Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #687164

    I’m using Events Calendar Pro and the Upcoming Events plugin addition when building some pages, and I wanted to add in the excerpt, but everything I’ve tried seems to fail.

    At around line 134 I added a line below:

    					$link	= get_permalink($entry->ID);
    					$my_excerpt = get_the_excerpt($entry->ID);

    And then at line 156 I added:
    $output .= "<p>".$my_excerpt."</p>";

    But nothing appears. I’ve also tried using the_excerpt and multiple variations. Am I missing something?

    #688647

    Hi,

    What file are you editing? can you create us a WordPress administrator account? post it here as a private reply.

    Regards,
    Josue

    #736139

    Circling back on this and hopefully someone can still help.

    The file is in config-templatebuilder > avia-shortcodes > events_upcoming.php and I’m trying to add the excerpt within the display at around line 155/156 or so within this code:

    		if($image)  $output .= $image;
    					$output .= "<span class='av-upcoming-event-data'>";
    						$output .= "<h4 class='av-upcoming-event-title'>{$title}</h4>";
    							$output .= "<span class='av-upcoming-event-meta'>";
    							$output .= "<span class='av-upcoming-event-schedule'>".tribe_events_event_schedule_details($entry)."</span>";
    							$output .= apply_filters('avf_upcoming_event_extra_data', "", $entry);
    							$output .= "</span>";
    						$output .= "</span>";
    					$output .= "</a>";

    I’ve tried using get_the_excerpt as well as this code below. Any tips would be appreciated as nothing seems to work to pull the excerpt or a portion of the_content.

    $output .= $content = apply_filters( 'the_excerpt', get_the_excerpt() );

    #736140

    I should add that I don’t want to waste anyone’s time making them login and such, but just need a tip on why the code to show an excerpt here doesn’t seem to be working no matter what I try. If it’s really easier I can provide admin access but I’m assuming I’m fairly close to the right answer here.

    #737030

    I realize it’s the weekend, but does anyone have ideas about this? It seems like it should be easy but literally nothing works. I’ve tried get_the_content, the_content, and even the_excerpt.

    #737032

    For the record, I had even found older code that a moderator had suggested, which is below, but it does not work in the current version. I also tried $entry->the_excerpt, and $entry->the_content;

    $excerpt = $entry->post_excerpt;
    							$output .= "<span class='av-upcoming-event-excerpt'>{$excerpt}</span>";
    • This reply was modified 7 years, 11 months ago by pgsmarketing.
    #738695

    Hi,

    Please replace the code with this.

    $excerpt = !empty(get_the_excerpt($entry->ID)) ? get_the_excerpt($entry->ID) :  get_the_content($entry->ID);
    if($excerpt) $output .= "<span class='av-upcoming-event-excerpt'>{$excerpt}</span>";
    

    Make sure that it is inside the foreach loop.

    Best regards,
    Ismael

    #743145

    I’ve tried every iteration of that, and all it seems to do is display the excerpt or content for the page it’s on, not for the event you’re trying to pull, creating a loop within a loop, but showing the HTML code for it.

    Is there another way to do this? I can’t quite imagine why there’s no default option to include the excerpt.

    #743205

    Hey!

    The solution Ismael is offering, is how you can solve it.
    Please do follow the directions and let us know if we can do anything else from our side.

    Thanks a lot for your time and patience.

    Cheers!
    Basilis

    #743466

    I don’t know what to tell you, but it’s not working on the home page. I took a screenshot that you can see here (https://ufile.io/8a6af) what it returns and the code is below. What am I missing? I added the code to the end of the section for output, but it’s pulling the home page’s own content with HTML/tags.

    if (!empty($entries))
    			{	global $post;
    				
    				$default_id = $post->ID;
    				$output .= "<div class='av-upcoming-events ".$meta['el_class']."'>";
    				foreach($entries as $entry)
    				{	
    					$class  = "av-upcoming-event-entry";
    					$image  = get_the_post_thumbnail($entry->ID, 'square', array( 'class' => 'av-upcoming-event-image' ));
    					$class .= !empty($image) ? " av-upcoming-event-with-image" : " av-upcoming-event-without-image";
    					$title  = get_the_title($entry->ID);
    					$link	= get_permalink($entry->ID);
    					
    					$post->ID = $entry->ID; //temp set of the post id so that tribe fetches the correct price symbol
    					$price  = tribe_get_cost( $entry->ID, true );
    					$venue  = tribe_get_venue( $entry->ID );
    					$post->ID = $default_id;
    					
    					$output .= "<a href='{$link}' class='{$class}'>";
    					
    		if($image)  $output .= $image;
    					$output .= "<span class='av-upcoming-event-data'>";
    						$output .= "<h4 class='av-upcoming-event-title'>{$title}</h4>";
    							$output .= "<span class='av-upcoming-event-meta'>";
    							$output .= "<span class='av-upcoming-event-schedule'>".tribe_events_event_schedule_details($entry)."</span>";
    							$output .= apply_filters('avf_upcoming_event_extra_data', "", $entry);
    							$output .= "</span>";
    						$output .= "</span>";
    					$output .= "</a>";
    					$excerpt = !empty(get_the_excerpt($entry->ID)) ? get_the_excerpt($entry->ID) :  get_the_content($entry->ID);
    if($excerpt) $output .= "<span class='av-upcoming-event-excerpt'>{$excerpt}</span>";
    				}
    #745707

    Hi,

    Please give this plugin a try https://wordpress.org/plugins/auto-excerpt-everywhere/

    It’s hasn’t been updated in awhile but should work for you fine :)

    Best regards,
    Vinay

    #801831

    Nevermind. Need to use magazine element to display event calendar posts as it has the sort function. Will create a separate support ticket. Thanks!

    • This reply was modified 7 years, 6 months ago by Eric. Reason: Will create separate thread more relevant to support need
    #801871

    Hi,

    Sure. Thanks for using Enfold :)

    Best regards,
    Nikko

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Add excerpt to Events Calendar Upcoming list’ is closed to new replies.