示例#1
0
文件: general.php 项目: TMBR/johnjohn
 /**
  * Event Categories (Display)
  *
  * Display the event categories with display param
  *
  * @category Events
  * @uses     tribe_get_event_taxonomy()
  * @replaces tribe_meta_event_cats()
  *
  * @param int   $post_id
  * @param array $args
  *
  * @return string $html (echo if provided in $args)
  */
 function tribe_get_event_categories($post_id = null, $args = array())
 {
     $events_label_singular = tribe_get_event_label_singular();
     $post_id = is_null($post_id) ? get_the_ID() : $post_id;
     $defaults = array('echo' => false, 'label' => null, 'label_before' => '<div>', 'label_after' => '</div>', 'wrap_before' => '<ul class="tribe-event-categories">', 'wrap_after' => '</ul>');
     $args = wp_parse_args($args, $defaults);
     $categories = tribe_get_event_taxonomy($post_id, $args);
     // check for the occurances of links in the returned string
     $label = is_null($args['label']) ? sprintf(_n('%s Category', '%s Categories', substr_count($categories, "<a href"), 'tribe-events-calendar'), $events_label_singular) : $args['label'];
     $html = !empty($categories) ? sprintf('%s%s:%s %s%s%s', $args['label_before'], $label, $args['label_after'], $args['wrap_before'], $categories, $args['wrap_after']) : '';
     if ($args['echo']) {
         echo apply_filters('tribe_get_event_categories', $html, $post_id, $args, $categories);
     } else {
         return apply_filters('tribe_get_event_categories', $html, $post_id, $args, $categories);
     }
 }
function the_breadcrumb()
{
    global $post;
    echo '<div class="silver breadcrumbs">';
    echo '<nav class="container">';
    echo '<ul>';
    if (!is_home()) {
        echo '<li><a href="';
        echo get_option('home');
        echo '">';
        echo '<i class="fa fa-home"></i>';
        echo '</a></li><li> / </li>';
        if (is_archive() && !tribe_is_event_category()) {
            echo '<li><a href="' . get_permalink(get_ID_by_slug('whats-new')) . '">' . get_the_title(get_ID_by_slug('whats-new')) . '</a><li/><li>';
            echo '</li><li> / </li><li><strong>' . return_child_cat('whats-new') . ' </strong>';
            //echo 'archive';
        } elseif (is_single() && !tribe_is_event_category()) {
            echo '<li><a href="' . get_permalink(get_ID_by_slug('whats-new')) . '">' . get_the_title(get_ID_by_slug('whats-new')) . '</a><li/><li>';
            echo '</li><li> / </li><li>';
            echo '<li>' . return_child_cat('whats-new', TRUE);
            echo '</li><li> / </li><li>';
            the_title();
            echo '</li>';
            //echo 'single';
        } elseif (is_page()) {
            //echo 'page';
            if ($post->post_parent) {
                $anc = get_post_ancestors($post->ID);
                $title = get_the_title();
                foreach ($anc as $ancestor) {
                    $output = '<li><a href="' . get_permalink($ancestor) . '" title="' . get_the_title($ancestor) . '">' . get_the_title($ancestor) . '</a></li> <li>/</li>';
                }
                echo $output;
                echo '<strong title="' . $title . '"> ' . $title . '</strong>';
            } else {
                echo '<li><strong> ' . get_the_title() . '</strong></li>';
            }
        } elseif (tribe_is_event() || tribe_is_event_category() || tribe_is_in_main_loop() || tribe_is_view() || 'tribe_events' == get_post_type() || is_singular('tribe_events')) {
            echo '<li><strong>Going out</strong></li>';
            echo '<li> / </li>';
            if (tribe_is_event_category()) {
                echo '<li><strong>' . tribe_get_event_taxonomy() . '</strong></li>';
            }
            if (is_singular('tribe_events')) {
                echo '<li> / </li>';
                echo '<li><strong>' . get_the_title() . '</strong></li>';
            }
        } elseif (is_search()) {
            echo '<li>Search Results: ' . the_search_query() . '</li>';
        }
    } elseif (is_tag()) {
        single_tag_title();
    } elseif (is_day()) {
        echo "<li>Archive for ";
        the_time('F jS, Y');
        echo '</li>';
    } elseif (is_month()) {
        echo "<li>Archive for ";
        the_time('F, Y');
        echo '</li>';
    } elseif (is_year()) {
        echo "<li>Archive for ";
        the_time('Y');
        echo '</li>';
    } elseif (is_author()) {
        echo "<li>Author Archive";
        echo '</li>';
    } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
        echo "<li>Blog Archives";
        echo '</li>';
    }
    echo '</ul>';
    echo '</nav>';
    echo '</div>';
}
			<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?"http":"https";if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document, "script", "twitter-wjs");</script>
		</div>
	</div>
	<div class="clearfix"></div>

	<div class="title-and-utility">
		<div class="page_title"><?php 
the_title();
?>
</div>
	</div>
	<div class="entry-bottom-utility">
		<div class="category-link">
			<span class="entry-utility-prep entry-utility-prep-cat-links"></span>
				<?php 
$categories = tribe_get_event_taxonomy($post->ID);
$categories = str_replace("<li>", "", $categories);
$categories = str_replace("</li>", "", $categories);
$categories = str_replace("</a>", "</a>, ", $categories);
echo substr($categories, 0, -2);
?>
		</div>
		<div class="clearfix"></div>
	</div>

	<!-- Notices -->
	<?php 
tribe_events_the_notices();
?>

	<?php 
示例#4
0
					</div> <!-- /.col-sm-7 .col-sm-push-4 .class-title -->	

					<div class="col-sm-3 col-sm-pull-7 item-details">
						<p class="item-date"><?php 
    echo tribe_get_start_date(null, false, 'l\\, F j');
    ?>
</p>
						<p class="item-time"><?php 
    echo tribe_get_start_date(null, false, 'g:ia');
    ?>
 &mdash; <?php 
    echo tribe_get_end_date(null, false, 'g:ia');
    ?>
</p>
						<p class="item-category"><?php 
    echo strip_tags(tribe_get_event_taxonomy($event_id, 'before=&sep=, &after'));
    ?>
</p>

<?php 
    if (get_field('intensive') == true) {
        ?>

			<p class="item-badge badge">Intensive</p>

			<?php 
    } else {
        ?>

<?php 
    }