事件日历-即将到来的事件短代码

author author     2023-03-23     388

关键词:

This shortcode was tested with The Events Calendar version 3.3.1
Usage: [upcoming_events limit="6"]
  1. function upcoming_events_shortcode($atts){
  2.  
  3. extract( shortcode_atts( array(
  4. 'limit' => 5,
  5. ), $atts ) );
  6.  
  7. $upcoming_events = tribe_get_events(array('posts_per_page'=>$limit, 'eventDisplay'=>'upcoming') );
  8.  
  9. $i=0;
  10. $result='<div id="event-box"><ul>';
  11.  
  12. foreach ( $upcoming_events as $post )
  13. {
  14. $sdate = date('n/j', strtotime( tribe_get_start_date($post->ID, true, 'm/j') ) );
  15. $stime = tribe_get_start_date( $post->ID, false, 'g:i a' );
  16. $etime = tribe_get_end_date( $post->ID, false, 'g:i a' );
  17.  
  18. $result .= '<li><h4><a class="blacklink" href="' . get_permalink($post->ID) . '">';
  19. if( $stime == '12:00 am' ){
  20. $result .= $sdate; //all day event
  21. }else if( $stime != $etime ){
  22. $result .= $sdate . ' <span class="time">@ ' . $stime . ' - ' . $etime . '</span>';
  23. }else{
  24. $result .= $sdate . ' <span class="time">@ ' . $stime . '</span>';
  25. }
  26.  
  27. $result .= '</a></h4><p>';
  28. $title = $post->post_title;
  29. $result .= substr($title, 0, 65);
  30. if (strlen($title) > 65) $result .= " ...";
  31. $result .= '</p>';
  32.  
  33. if( ($i%$limit) == 0 && $i>0) { $result .= '</li>'; }
  34. $i++;
  35. }//end foreach
  36. $result .= '</ul></div><!-- end #event-box -->';
  37. return $result;
  38. }
  39. add_shortcode( 'upcoming_events', 'upcoming_events_shortcode' );

php事件短代码-事件日历wordpress插件(代码片段)

查看详情

通过将日期与日历日期进行比较来加载即将发生的事件

】通过将日期与日历日期进行比较来加载即将发生的事件【英文标题】:loadingupcomingeventsbycomparingtheirdateswiththecalendardate【发布时间】:2014-02-0600:22:28【问题描述】:我在网上找到了以下代码,用于比较两个日期(日历的日期和... 查看详情

php事件日历:覆盖默认的ical导出为超过30个即将发生的事件(仅影响列表,地图和照片视图)。(代码片段)

查看详情

php事件日历:覆盖默认的ical导出为超过30个即将发生的事件(仅影响列表,地图和照片视图)。(代码片段)

查看详情

Drupal 6:我如何只在即将到来的日期之前调用“事件”?

】Drupal6:我如何只在即将到来的日期之前调用“事件”?【英文标题】:Drupal6:HowdoIonlycallup"events"byupcomingdate?【发布时间】:2009-09-1815:49:38【问题描述】:我是Drupal的新手,所以这可能是一个简单的答案...我正在建立一... 查看详情

如何使用 EF & ASP.NET MVC 获取即将发生的事件列表

】如何使用EF&ASP.NETMVC获取即将发生的事件列表【英文标题】:HowtogetalistofupcomingEventsusingEF&ASP.NETMVC【发布时间】:2020-06-0701:07:09【问题描述】:如何使用EntityFramework和ASP.NETMVC获取即将发生的事件的数据?我想显示即将到来... 查看详情

我们如何检索位于特定国家(地区)的即将到来的 Facebook 活动?

...8:50:10【问题描述】:我想在特定位置访问整个FB上列出的事件?这些事件是指公开事件。【问题讨论】:【参考方案1】:我之前在很多渠道都问过好几次了,但 查看详情

php事件日历pro:即使对于tribe_events短代码,也使tribe_is_week()返回true。(代码片段)

查看详情

php事件日历pro:即使对于tribe_events短代码,也使tribe_is_week()返回true。(代码片段)

查看详情

phpmyadmin:数据库事件

】phpmyadmin:数据库事件【英文标题】:phpmyadmin:databaseevents【发布时间】:2015-12-3113:28:45【问题描述】:当记录的日期(即将到来的)等于今天的日期时,我正在尝试将记录从一个表(即将到来的)移动到另一个表(今天)。我... 查看详情

php事件日历pro:将pro_addl_fields变量添加到tribe_event_inline短代码中。(代码片段)

查看详情

在角度管理器应用程序中选择即将发生的事件

】在角度管理器应用程序中选择即将发生的事件【英文标题】:Choosingtheupcomingeventinaangularorganizerapplication【发布时间】:2020-04-1716:41:33【问题描述】:我正在用angular创建一个管理器应用程序。这里我想通过单独显示来突出显示... 查看详情

如何选择即将到来的日期和时间的记录?

...ime。我目前正在处理一个页面,它将显示所有即将发生的事件。如何从events表中查询日期和时间仍将到来的记录?我的意思是,如何使用MySQL计算或编写查询, 查看详情

如何使用 Android Studio 中的意图读取一周的日历事件?

】如何使用AndroidStudio中的意图读取一周的日历事件?【英文标题】:HowtoreadcalendareventfortheweekusingintentsinAndroidStudio?【发布时间】:2021-07-1001:13:09【问题描述】:嘿,我正在制作一个语音助手应用程序,并且想让用户知道即将发... 查看详情

php插件事件日历事件日历(代码片段)

查看详情

php事件日历:将“所有事件”链接转换为真正的“后退”按钮。(代码片段)

查看详情

php事件日历:将“所有事件”链接转换为真正的“后退”按钮。(代码片段)

查看详情

php事件日历:事件聚合器:查找缺少所需uid的导入ical事件。(代码片段)

查看详情