<?php
/* 
* Theme: PREMIUMPRESS CORE FRAMEWORK FILE
* Url: www.premiumpress.com
* Author: Mark Fail
*
* THIS FILE WILL BE UPDATED WITH EVERY UPDATE
* IF YOU WANT TO MODIFY THIS FILE, CREATE A CHILD THEME
*
* http://codex.wordpress.org/Child_Themes
*/
if (!defined('THEME_VERSION')) {	header('HTTP/1.0 403 Forbidden'); exit; }

global $CORE, $post, $userdata, $CORE_UI;

  
if(isset($GLOBALS['flag-taxonomy'])){

    $GLOBALS['flag-taxonomy-title'] = "";

///////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////
 
$term = get_term_by('slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); 

$default_country = "country";
			if(strlen(get_option('premiumpress_countrypermalink')) > 1){ 
				$default_country = get_option('premiumpress_countrypermalink');
			}

///////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////
 

?>
<div class="container">    
    
    <nav ppt-nav class="spacing seperator crumbs small pl-0">
    <ul>
        
    <li><a href="<?php echo home_url(); ?>" class="text-dark"><?php echo __("Home","premiumpress"); ?></a></li>
    
    <?php if(isset($term->term_id) && $term->taxonomy == "store" &&  _ppt(array('links','stores')) != "" ){ ?>
    
      <li><a href="<?php echo _ppt(array('links','stores')); ?>" class="text-dark"><?php if(in_array(THEME_KEY,array("es"))){ echo __("All Agencies","premiumpress");  }else{  echo __("All Stores","premiumpress"); } ?></a></li>
      
   <?php } ?> 
      
   <?php if(isset($term->term_id) && $term->taxonomy == "listing" &&  _ppt(array('links','categories')) != "" ){ ?>
     
    <li><a href="<?php echo _ppt(array('links','categories')); ?>" class="text-dark"><?php echo __("All Categories","premiumpress"); ?></a></li>

    <?php }elseif(isset($term->term_id) && $term->taxonomy == "country" &&  _ppt(array('links','countries')) != "" ){ ?>
       
        <li><a href="<?php echo _ppt(array('links','countries')); ?>" class="text-dark"><?php echo __("All Countries","premiumpress"); ?></a></li>
   
   <?php } ?>
    
    <?php if(isset($term->parent) && $term->parent != 0){ $mc  = get_term_by( 'id', $term->parent, get_query_var( 'taxonomy' ) ); 
    
        $sub = get_term_by( 'id', $term->parent, get_query_var( 'taxonomy' ) ); 
     
        if(isset($sub->term_id)){ 
        
            if(isset($sub->parent) && $sub->parent != 0){
        
                $subsub = get_term_by( 'id', $sub->parent, get_query_var( 'taxonomy' ) );
        
                if(isset($subsub->term_id)){ ?>
           
                    <li><a href="<?php echo get_term_link($subsub->term_id, get_query_var( 'taxonomy' )); ?>" class="text-dark"><?php $GLOBALS['flag-taxonomy-title'] = $CORE->GEO("translation_tax_with_termdata", $subsub); echo $GLOBALS['flag-taxonomy-title']; ?></a></li>
            
                <?php } 
        
            } ?>
           
        <li><a href="<?php echo str_replace("country/", $default_country."/", get_term_link($sub->term_id, get_query_var( 'taxonomy' ))); ?>" class="text-dark"><?php  $GLOBALS['flag-taxonomy-title'] = $CORE->GEO("translation_tax_with_termdata", $sub); echo $GLOBALS['flag-taxonomy-title']; ?></a></li>
            
        <?php }
    } 
		  
         
     if(isset($term->term_id)){ ?>
       
    <li><a href="<?php echo str_replace("country/", $default_country."/",get_term_link($term->term_id, $term->taxonomy)); ?>" class="text-dark"><?php $GLOBALS['flag-taxonomy-title'] = $CORE->GEO("translation_tax_with_termdata", $term); echo $GLOBALS['flag-taxonomy-title']; ?></a></li>
        
    <?php } ?> 
    </ul>

    </nav>

</div>
  
<?php } ?>