本文整理汇总了PHP中tribe_get_template_part函数的典型用法代码示例。如果您正苦于以下问题:PHP tribe_get_template_part函数的具体用法?PHP tribe_get_template_part怎么用?PHP tribe_get_template_part使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tribe_get_template_part函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: es_calendar
function es_calendar($atts)
{
ob_start();
?>
<div class="tribe-header-nav">
<?php
tribe_get_template_part('month/nav');
?>
</div>
<div class="events-archive events-gridview">
<div id="tribe-events-content">
<div id="home-calendar">
</div>
</div>
</div>
<?php
$content = ob_get_contents();
ob_clean();
return $content;
}
示例2: get_map
/**
* Returns the placeholder HTML needed to embed a map within a page and
* additionally enqueues supporting scripts, etc.
*
* @param int $post_id ID of the pertinent event or venue
* @param int $width
* @param int $height
* @param bool $force_load add the map even if no address data can be found
*
* @return string
*/
public function get_map($post_id, $width, $height, $force_load)
{
$this->get_ids($post_id);
// Bail if either the venue or event couldn't be determined
if (!tribe_is_venue($this->venue_id) && !tribe_is_event($this->event_id)) {
return apply_filters('tribe_get_embedded_map', '');
}
$this->form_address();
if (empty($this->address) && !$force_load) {
return apply_filters('tribe_get_embedded_map', '');
}
$this->embedded_maps[] = array('address' => $this->address, 'title' => esc_html(get_the_title($this->venue_id)));
end($this->embedded_maps);
$index = key($this->embedded_maps);
// Generate the HTML used to "house" the map
ob_start();
tribe_get_template_part('modules/map', null, array('index' => $index, 'width' => null === $width ? apply_filters('tribe_events_single_map_default_width', '100%') : $width, 'height' => null === $height ? apply_filters('tribe_events_single_map_default_height', '350px') : $height));
$this->setup_scripts();
do_action('tribe_events_map_embedded', $index, $this->venue_id);
return apply_filters('tribe_get_embedded_map', ob_get_clean());
}
示例3: tribe_show_month
/**
* Display a month
*
* Inline example:
* < code >
* <?php
* // output the events in May 2016 using the full month view template
* tribe_show_month( array( 'eventDate' => '2016-05-01' ) )
* ?>
* </ code >
*
* @param array $args query args to pass to the month view
* @param string $template_path template to use, defaults to the full month view
* @return void
* @author Jessica Yazbek
* @since 3.0
**/
function tribe_show_month($args = array(), $template_path = 'month/content')
{
// temporarily unset the tribe bar params so they don't apply
$hold_tribe_bar_args = array();
foreach ($_REQUEST as $key => $value) {
if ($value && strpos($key, 'tribe-bar-') === 0) {
$hold_tribe_bar_args[$key] = $value;
unset($_REQUEST[$key]);
}
}
$month_class = new Tribe_Events_Month_Template($args);
$month_class->setup_view();
do_action('tribe_events_before_show_month');
tribe_get_template_part($template_path);
do_action('tribe_events_after_show_month');
// reinstate the tribe bar params
if (!empty($hold_tribe_bar_args)) {
foreach ($hold_tribe_bar_args as $key => $value) {
$_REQUEST[$key] = $value;
}
}
}
示例4: do_action
do_action('tribe_events_after_loop');
?>
<?php
}
?>
<!-- List Footer -->
<?php
do_action('tribe_events_before_footer');
?>
<div id="tribe-events-footer">
<!-- Footer Navigation -->
<?php
do_action('tribe_events_before_footer_nav');
?>
<?php
tribe_get_template_part('list/nav', 'footer');
?>
<?php
do_action('tribe_events_after_footer_nav');
?>
</div>
<!-- #tribe-events-footer -->
<?php
do_action('tribe_events_after_footer');
?>
</div><!-- #tribe-events-content -->
示例5: while
<?php
echo $day['daynum'];
?>
<?php
}
?>
</div>
<!-- Events List -->
<?php
while ($day['events']->have_posts()) {
$day['events']->the_post();
?>
<?php
tribe_get_template_part('month/single', 'event');
?>
<?php
}
?>
<!-- View More -->
<?php
if ($day['view_more'] && tribe_events_is_view_enabled('day')) {
?>
<div class="tribe-events-viewmore">
<?php
$view_all_label = sprintf(_n('View 1 Event', 'View All %s Events', $day['total_events'], 'tribe-events-calendar'), $day['total_events']);
?>
<a href="<?php
echo $day['view_more'];
示例6: the_ID
</h5>
</div>
<?php
}
?>
<!-- event -->
<div id="post-<?php
the_ID();
?>
" class="<?php
tribe_events_event_classes($class);
?>
">
<?php
tribe_get_template_part('day/single', 'event-2');
?>
</div>
<!-- .hentry .event -->
<?php
do_action('tribe_events_inside_after_loop');
?>
<?php
}
?>
</div>
</div>
<!-- .tribe-events-day-time-slot -->
</div><!-- .tribe-events-loop -->
示例7: additional_fields
/**
* Render additional field data within the single event view meta section.
*/
public function additional_fields()
{
tribe_get_template_part('pro/modules/meta/additional-fields', null, array('fields' => tribe_get_custom_fields()));
}
示例8: do_calendar
/**
*
* returns the full markup for the AJAX Calendar
*
* @static
*
* @param array $args
* -----> eventDate: date What month-year to print
* count: int # of events in the list (doesn't affect the calendar).
* tax_query: array For the events list (doesn't affect the calendar).
* Same format as WP_Query tax_queries. See sample below.
*
*
* tax_query sample:
*
* array( 'relation' => 'AND',
* array( 'taxonomy' => 'tribe_events_cat',
* 'field' => 'slug',
* 'terms' => array( 'featured' ),
* array( 'taxonomy' => 'post_tag',
* 'field' => 'id',
* 'terms' => array( 103, 115, 206 ),
* 'operator' => 'NOT IN' ) ) );
*
*
*/
public function do_calendar($args = array())
{
$this->args = $args;
// Disable tooltips
$ecp = Tribe__Events__Pro__Main::instance();
$tooltip_status = $ecp->recurring_info_tooltip_status();
$ecp->disable_recurring_info_tooltip();
if (!isset($this->args['eventDate'])) {
$this->args['eventDate'] = $this->get_month();
}
// don't show the list if they set it the widget option to show 0 events in the list
if ($this->args['count'] == 0) {
$this->show_list = false;
}
// enqueue the widget js
self::styles_and_scripts();
// widget setting for count is not 0
if (!$this->show_list) {
add_filter('tribe_events_template_widgets/mini-calendar/list.php', '__return_false');
}
tribe_get_template_part('pro/widgets/mini-calendar-widget');
if ($tooltip_status) {
$ecp->enable_recurring_info_tooltip();
}
}
示例9: tribe_get_template_part
tribe_get_template_part('pro/widgets/this-week/nav', 'header', array('start_date' => $this_week_template_vars['start_date'], 'end_date' => $this_week_template_vars['end_date']));
?>
<!-- This Week Grid -->
<div class="tribe-this-week-widget-weekday-wrapper <?php
echo esc_html('true' === $this_week_template_vars['hide_weekends'] ? 'tribe-this-week-widget-hide-weekends' : '');
?>
" >
<?php
foreach ($week_days as $day) {
?>
<!-- This Week Day -->
<?php
tribe_get_template_part('pro/widgets/this-week/loop-grid-day', 'grid-dau', array('day' => $day, 'this_week_template_vars' => $this_week_template_vars));
?>
<?php
}
?>
</div>
</div>
<?php
if ((isset($args['widget_id']) || isset($instance['widget_id'])) && (isset($instance['highlight_color']) && $instance['highlight_color'] != '')) {
//Set Highlight Color for Widget or For Shortcode based on ID from Respective System
$wrap_id = isset($args['widget_id']) ? $args['widget_id'] : '';
if (is_numeric($wrap_id)) {
示例10: tribe_event_format_date
?>
"
<?php
//Add Day Name Option for Responsive Header
if ($daydata['total_events'] > 0) {
$day_name = tribe_event_format_date($daydata['date'], false);
?>
data-date-name="<?php
echo $day_name;
?>
"
<?php
}
?>
<?php
}
?>
>
<?php
tribe_get_template_part('month/single', 'day');
?>
</td>
<?php
}
?>
</tr>
</tbody>
</table><!-- .tribe-events-calendar -->
<?php
do_action('tribe_events_after_the_grid');
示例11: tribe_events_get_list_widget_view_all_link
// The URL for this widget's "View More" link.
$link_to_all = tribe_events_get_list_widget_view_all_link($instance);
// Check if any posts were found.
if (isset($posts) && $posts) {
foreach ($posts as $post) {
setup_postdata($post);
do_action('tribe_events_widget_list_inside_before_loop');
?>
<!-- Event -->
<div class="<?php
tribe_events_event_classes();
?>
">
<?php
tribe_get_template_part('pro/widgets/modules/single-event', null, $instance);
?>
</div><!-- .hentry .vevent -->
<?php
do_action('tribe_events_widget_list_inside_after_loop');
?>
<?php
}
?>
<p class="tribe-events-widget-link">
<a href="<?php
esc_attr_e(esc_url($link_to_all));
?>
示例12: die
<?php
/**
* Day View Template
* The wrapper template for day view.
*
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/day.php
*
* @package TribeEventsCalendar
*
*/
if (!defined('ABSPATH')) {
die('-1');
}
do_action('tribe_events_before_template');
?>
<!-- Tribe Bar -->
<?php
tribe_get_template_part('modules/bar');
?>
<!-- Main Events Content -->
<?php
tribe_get_template_part('day/content');
?>
<div class="tribe-clear"></div>
<?php
do_action('tribe_events_after_template');
示例13: while
<div class="tribe-grid-content-wrap">
<?php
while (tribe_events_week_have_days()) {
tribe_events_week_the_day();
tribe_events_week_reset_the_day_map();
?>
<div title="<?php
tribe_events_week_get_the_date();
?>
" class="tribe-events-mobile-day column <?php
tribe_events_week_column_classes();
?>
">
<?php
foreach (tribe_events_week_get_all_day_map() as $all_day_cols) {
tribe_events_week_the_day_map();
?>
<?php
tribe_get_template_part('pro/week/single-event', 'allday');
?>
<?php
}
?>
</div><!-- allday column -->
<?php
}
?>
</div><!-- .tribe-grid-content-wrap -->
</div><!-- .tribe-grid-allday -->
<?php
}
示例14: die
* @package TribeEventsCalendar
*
*/
if (!defined('ABSPATH')) {
die('-1');
}
?>
<?php
do_action('tribe_events_before_template');
?>
<!-- Google Map Container -->
<?php
tribe_get_template_part('pro/map/gmap-container');
?>
<!-- Tribe Bar -->
<?php
tribe_get_template_part('modules/bar');
?>
<!-- Main Events Content -->
<?php
tribe_get_template_part('pro/map/content');
?>
<div class="tribe-clear"></div>
<?php
do_action('tribe_events_after_template');
示例15: types_render_field
}
}
}
}
}
?>
</h1>
<?php
if (is_single()) {
$subtitle = types_render_field("subtitle", array("raw" => "true"));
if (!empty($subtitle)) {
echo "<h2 class='subtitle'>{$subtitle}</h2>";
}
}
if (tribe_is_month() || tribe_is_list_view()) {
tribe_get_template_part('modules/bar');
}
?>
</header>
</div> <!-- end left block -->
<?php
}
?>
<nav role="navigation" class="site-navigation">
<div class="home-page-link"><a href="<?php
echo esc_url(home_url('/'));
?>
" class="icon-home"><span>Home</span></a></div>
<h1 class="assistive-text icon-menu"><span>Menu</span></h1>
<div class="assistive-text skip-link"><a href="#content" title="Skip to content">Skip to content</a></div>
<?php