コード例 #1
0
 /**
  * Filters the_content to show the event when we are in the main loop and showing events
  *
  * @param string $content
  * @return string Filtered content
  * @since 2.1
  */
 public static function hijackContentInMainLoop($content)
 {
     // only run once!!!
     remove_filter('the_content', array(__CLASS__, 'hijackContentInMainLoop'));
     global $post;
     if (tribe_is_in_main_loop() && tribe_is_event($post->ID)) {
         ob_start();
         echo stripslashes(tribe_get_option('tribeEventsBeforeHTML'));
         include_once self::getTemplateHierarchy('in-loop');
         echo stripslashes(tribe_get_option('tribeEventsAfterHTML'));
         $content = ob_get_contents();
         ob_end_clean();
     }
     return $content;
 }
コード例 #2
0
ファイル: tribe-events.php プロジェクト: iq007/MadScape
 /**
  * Helper function checks if we are currently on an events page/post/archive
  *
  * @since  2.0.0
  * @access public
  */
 public static function is_tribe_events()
 {
     if (is_search()) {
         return false;
     }
     if (tribe_is_event() || tribe_is_event_category() || tribe_is_in_main_loop() || tribe_is_view() || is_singular('tribe_events')) {
         return true;
     }
 }
コード例 #3
0
<!--<div class="side_foot"></div>-->
<div class="mobile_sub">Sub Menu<i class='fa fa-chevron-down'></i></div>

<div class="side_nav_wrap">
	
<!--News Pages--->
<?php 
if (is_home() || is_single() && 'tribe_events' != get_post_type() && !is_singular('tribe_events')) {
    echo do_shortcode('[widget id="recent-posts-2"]');
    echo do_shortcode('[widget id="archives-2"]');
}
?>

<!---Training Pages and Courses--->
<?php 
if (is_page(16) || $post->post_parent == '16' || tribe_is_event() || tribe_is_event_category() || tribe_is_in_main_loop() || tribe_is_view() || 'tribe_events' == get_post_type() || is_singular('tribe_events')) {
    ?>
<h3 class="ancestor_title"><a href="<?php 
    echo esc_url(home_url('/'));
    ?>
training">Training</a></h3>
<?php 
    echo do_shortcode('[widget id="nav_menu-7"]');
}
?>

<!---Members Pages--->
<!--Get the Grandparent of the page-->
<?php 
$current = $post->ID;
$parent = $post->post_parent;
コード例 #4
0
<?php

use Roots\Sage\Titles;
?>
<div class="page-header"> 
  <?php 
if (tribe_is_event() || tribe_is_event_category() || tribe_is_in_main_loop() || tribe_is_view() || 'tribe_events' == get_post_type() || is_singular('tribe_events')) {
    ?>
  <h1>Training</h1>
  <?php 
} else {
    ?>
  <h1><?php 
    echo Titles\title();
    ?>
</h1>
  <?php 
}
?>
 
</div>
コード例 #5
0
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>';
}
コード例 #6
0
ファイル: layout-subnav.php プロジェクト: ChongoShaun/lpp
	<section id="secondary-navigation">
		<div class="big-container full-width">
			<div class="container">
				<ul class="clearfix">
					<?php 
if (is_page('news') || tribe_is_event() || tribe_is_month() && !is_tax() || (tribe_is_past() || tribe_is_upcoming() && !is_tax()) || tribe_is_day() && !is_tax() || tribe_is_event_category() || tribe_is_in_main_loop() || tribe_is_view() || 'tribe_events' == get_post_type() || is_singular('tribe_events')) {
    ?>
						<li class="page_item page-item-37">
							<a></a>
						</li>					
					<?php 
} else {
    ?>
						
					    <?php 
    wp_list_pages(array('title_li' => '', 'include' => get_post_top_ancestor_id()));
    ?>
					    <?php 
    wp_list_pages(array('title_li' => '', 'depth' => 1, 'child_of' => get_post_top_ancestor_id()));
    ?>
						
					<?php 
}
?>
				</ul>
			</div>
		</div>
	</section>