Example #1
0
 /**
  * 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;
     }
 }
Example #2
0
 function axiom_is_tribe_events_page()
 {
     return class_exists('TribeEvents') ? tribe_is_event() || tribe_is_event_query() || tribe_is_event_category() || tribe_is_event_venue() || tribe_is_event_organizer() : false;
 }
Example #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;
<?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>
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>';
}
Example #6
0
 function showBreadcrumbs($args = array())
 {
     global $wp_query, $post;
     $args = array_merge(array('home' => __('Home', 'themerex'), 'home_url' => '', 'show_all_filters' => true, 'show_all_posts' => true, 'truncate_title' => 50, 'truncate_add' => '...', 'delimiter' => ' / ', 'max_levels' => get_theme_option('breadcrumbs_max_level'), 'echo' => true), is_array($args) ? $args : array('home' => $args));
     $rez = '';
     $rez2 = '';
     $rez_all = '';
     $rez_level = '';
     $type = getBlogType();
     $title = getShortString(getBlogTitle(), $args['truncate_title'], $args['truncate_add']);
     $cat = '';
     $parentTax = '';
     $level = 0;
     if ($args['max_levels'] <= 0) {
         $args['max_levels'] = 999;
     }
     $args['delimiter'] = '<span class="breadcrumbs_delimiter">' . $args['delimiter'] . '</span>';
     if (!in_array($type, array('home', 'frontpage'))) {
         $need_reset = true;
         $parent = 0;
         $post_id = 0;
         if ($type == 'page' || $type == 'attachment') {
             $pageParentID = isset($wp_query->post->post_parent) ? $wp_query->post->post_parent : 0;
             $post_id = $type == 'page' ? isset($wp_query->post->ID) ? $wp_query->post->ID : 0 : $pageParentID;
             while ($pageParentID > 0) {
                 $pageParent = get_post($pageParentID);
                 $level++;
                 if ($level > $args['max_levels']) {
                     $rez_level = '...';
                 } else {
                     $rez2 = '<a class="cat_post" href="' . get_permalink($pageParent->ID) . '">' . getShortString($pageParent->post_title, $args['truncate_title'], $args['truncate_add']) . '</a>' . (!empty($rez2) ? $args['delimiter'] : '') . $rez2;
                 }
                 if (($pageParentID = $pageParent->post_parent) > 0) {
                     $post_id = $pageParentID;
                 }
             }
         } else {
             if ($type == 'single') {
                 $post_id = isset($wp_query->post->ID) ? $wp_query->post->ID : 0;
             }
         }
         $depth = 0;
         $ex_cats = explode(',', get_theme_option('exclude_cats'));
         $taxonomy = themerex_strpos($type, 'woocommerce') !== false ? array('product_cat') : (themerex_strpos($type, 'tribe') !== false ? array('tribe_events_cat') : array('category'));
         do {
             if ($depth++ == 0) {
                 if (in_array($type, array('single', 'attachment', 'woocommerce_product', 'tribe_event'))) {
                     if (!in_array($type, array('woocommerce_product', 'tribe_event')) && $args['show_all_filters']) {
                         $post_format = get_post_format($post_id);
                         if (($tpl_id = getTemplatePageId('only-' . $post_format)) > 0) {
                             $level++;
                             if ($level > $args['max_levels']) {
                                 $rez_level = '...';
                             } else {
                                 $rez_all .= (!empty($rez_all) ? $args['delimiter'] : '') . '<a class="all" href="' . get_permalink($tpl_id) . '">' . sprintf(__('All %s', 'themerex'), getPostFormatName($post_format, false)) . '</a>';
                             }
                         }
                     }
                     $cats = getCategoriesByPostId($post_id, $taxonomy);
                     $cat = $cats ? $cats[0] : false;
                     if ($cat) {
                         if (!in_array($cat['term_id'], $ex_cats)) {
                             $cat_link = get_term_link($cat['slug'], $cat['taxonomy']);
                             $level++;
                             if ($level > $args['max_levels']) {
                                 $rez_level = '...';
                             } else {
                                 $rez2 = '<a class="cat_post" href="' . $cat_link . '">' . getShortString($cat['name'], $args['truncate_title'], $args['truncate_add']) . '</a>' . (!empty($rez2) ? $args['delimiter'] : '') . $rez2;
                             }
                         }
                     } else {
                         $post_type = get_post_type($post_id);
                         $parentTax = 'category' . ($post_type == 'post' ? '' : '_' . $post_type);
                     }
                 } else {
                     if ($type == 'category') {
                         $cat = get_term_by('id', get_query_var('cat'), 'category', ARRAY_A);
                     } else {
                         if (themerex_strpos($type, 'woocommerce') !== false) {
                             if (is_product_category()) {
                                 $cat = get_term_by('slug', get_query_var('product_cat'), 'product_cat', ARRAY_A);
                             }
                         } else {
                             if (themerex_strpos($type, 'tribe') !== false) {
                                 if (tribe_is_event_category()) {
                                     $cat = get_term_by('slug', get_query_var('tribe_events_cat'), 'tribe_events_cat', ARRAY_A);
                                 }
                             }
                         }
                     }
                 }
                 if ($cat) {
                     $parent = $cat['parent'];
                     $parentTax = $cat['taxonomy'];
                 }
             }
             if ($parent) {
                 $cat = get_term_by('id', $parent, $parentTax, ARRAY_A);
                 if ($cat) {
                     if (!in_array($cat['term_id'], $ex_cats)) {
                         $cat_link = get_term_link($cat['slug'], $cat['taxonomy']);
                         $level++;
                         if ($level > $args['max_levels']) {
                             $rez_level = '...';
                         } else {
                             $rez2 = '<a class="cat_parent" href="' . $cat_link . '">' . getShortString($cat['name'], $args['truncate_title'], $args['truncate_add']) . '</a>' . (!empty($rez2) ? $args['delimiter'] : '') . $rez2;
                         }
                     }
                     $parent = $cat['parent'];
                 }
             }
         } while ($parent);
         if (themerex_strpos($type, 'woocommerce') !== false && ($shop_id = get_option('woocommerce_shop_page_id')) > 0 && !in_array(themerex_strtolower($title), array(themerex_strtolower($shop_title = getPostTitle($shop_id))))) {
             $rez_all = '<a class="all" href="' . get_permalink($shop_id) . '">' . $shop_title . '</a>' . (!empty($rez_all) ? $args['delimiter'] : '') . $rez_all;
         }
         if (themerex_strpos($type, 'tribe') !== false && !in_array(themerex_strtolower($title), array(__('All Events', 'themerex'), __('Tribe Events', 'themerex')))) {
             $rez_all = '<a class="all" href="' . tribe_get_events_link() . '">' . __('All Events', 'themerex') . '</a>' . (!empty($rez_all) ? $args['delimiter'] : '') . $rez_all;
         }
         if ($args['show_all_posts'] && !in_array(themerex_strtolower($title), array(themerex_strtolower(__('All Posts', 'themerex')))) && ($blog_id = getTemplatePageId('blog')) > 0) {
             $rez_all = '<a class="all" href="' . get_permalink($blog_id) . '">' . __('All Posts', 'themerex') . '</a>' . (!empty($rez_all) ? $args['delimiter'] : '') . $rez_all;
         }
         $rez3 = '';
         if ($type == 'tribe_day' && is_object($post)) {
             $rez3 .= (!empty($rez3) ? $args['delimiter'] : '') . '<a class="cat_parent" href="' . tribe_get_gridview_link(false) . '">' . date_i18n(tribe_get_option('monthAndYearFormat', 'F Y'), strtotime(tribe_get_month_view_date())) . '</a>';
         } else {
             if (themerex_strpos($type, 'woocommerce') === false && is_archive() && is_object($post)) {
                 $year = get_the_time('Y');
                 $month = get_the_time('m');
                 if (is_day() || is_month()) {
                     $rez3 .= (!empty($rez3) ? $args['delimiter'] : '') . '<a class="cat_parent" href="' . get_year_link($year) . '">' . $year . '</a>';
                 }
                 if (is_day()) {
                     $rez3 .= (!empty($rez3) ? $args['delimiter'] : '') . '<a class="cat_parent" href="' . get_month_link($year, $month) . '">' . prepareDateForTranslation(get_the_date('F')) . '</a>';
                 }
             }
         }
         if (!is_front_page()) {
             // && !is_home()
             $rez .= (isset($args['home']) && $args['home'] != '' ? '<a class="home" href="' . ($args['home_url'] ? $args['home_url'] : home_url()) . '">' . $args['home'] . '</a>' . $args['delimiter'] : '') . (!empty($rez_all) ? $rez_all . $args['delimiter'] : '') . (!empty($rez_level) ? $rez_level . $args['delimiter'] : '') . (!empty($rez2) ? $rez2 . $args['delimiter'] : '') . (!empty($rez3) ? $rez3 . $args['delimiter'] : '') . ($title ? '<span class="current">' . $title . '</span>' : '');
         }
     }
     if ($args['echo'] && !empty($rez)) {
         echo balanceTags($rez);
     }
     return $rez;
 }
Example #7
0
	<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>
?>
    
    <?php 
if (get_field('content_image')) {
    ?>
    <img class="content_image" src="<?php 
    the_field('content_image');
    ?>
" alt="<?php 
    the_title();
    ?>
" />
    <?php 
}
?>
    
    <?php 
get_template_part('templates/content', 'page');
?>
    
    <!--Training Content-->
    <?php 
if (tribe_is_event_category()) {
    ?>
     <?php 
    get_template_part('templates/training_extra_courses');
    ?>
    <?php 
}
?>
</div>