dalbeck

Sidebar

Jan 4th, 2013
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.07 KB | None | 0 0
  1. <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('Sidebar Left')) : else : ?>
  2.  
  3. <?php if (is_home() || is_category() || is_single()) { ?>
  4.  
  5.             <article class="moreinfo blog-categories singluar">
  6.  
  7.                 <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar Blog')) : ?> <?php endif; ?>
  8.  
  9.             </article><!--end of .moreinfo-->
  10.  
  11.             <article class="moreinfo singluar">
  12.  
  13.                 <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar Blog 2')) : ?> <?php endif; ?>
  14.  
  15.             </article><!--end of .moreinfo-->
  16.  
  17.             <article class="events singluar">
  18.  
  19.                 <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar 1')) : ?> <?php endif; ?>
  20.  
  21.             </article><!--end of events-->
  22.  
  23. <?php if ( $query->query_vars['eventDisplay'] == 'upcoming' || $query->query_vars['eventDisplay'] == 'past' || $query->query_vars['eventDisplay'] == 'month' && $query->query_vars['post_type'] == TribeEvents::POSTTYPE && !is_tax(TribeEvents::TAXONOMY) && empty( $query->query_vars['suppress_filters'] ) ) { ?>
  24. <!--Condition for Events Calendar-->
  25.  
  26.             <article class="moreinfo">
  27.  
  28.                 <h6><a href="<?php echo get_permalink(10); ?>">Events &amp; News</a></h6>
  29.  
  30.                 <ul class="moreinfo">
  31.                     <li><a href="<?php echo home_url(); ?>/events">Events</a></li>
  32.                     <li><a href="<?php echo home_url(); ?>/blog">News</a></li>
  33.                     <li><a href="<?php echo get_permalink(204); ?>">Newsletters</a></li>
  34.                 </ul>
  35.  
  36.             </article><!--end of .moreinfo-->
  37.  
  38.             <article class="events">
  39.  
  40.                 <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar 1')) : ?> <?php endif; ?>
  41.  
  42.             </article><!--end of events-->
  43.  
  44. <?php } ?>
  45.  
  46. <?php } elseif (is_page()) { ?>
  47.  
  48.             <article class="moreinfo">
  49.  
  50.                 <h6>
  51.                     <a href="<?php echo get_permalink($post->post_parent) ?>">
  52.  
  53.                     <?php
  54.                         $current = $post->ID;
  55.                         $parent = $post->post_parent;
  56.                         $grandparent_get = get_post($parent);
  57.                         $grandparent = $grandparent_get->post_parent;
  58.                     ?>
  59.                     <?php if ($root_parent = get_the_title($grandparent) !== $root_parent = get_the_title($current)) { echo get_the_title($grandparent); } else { echo get_the_title($parent); } ?>
  60.  
  61.                     </a>
  62.                 </h6>
  63.  
  64.                 <?php
  65.  
  66.                   if($post->post_parent) {
  67.                   $children = wp_list_pages("sort_column=menu_order&link_before=<span>&link_after=</span>&title_li=&child_of=".$post->post_parent."&echo=0");
  68.                   $titlenamer = get_the_title($post->post_parent);
  69.                   }
  70.  
  71.                   else {
  72.                   $children = wp_list_pages("sort_column=menu_order&link_before=<span>&link_after=</span>&title_li=&child_of=".$post->ID."&echo=0");
  73.                   $titlenamer = get_the_title($post->ID);
  74.                   }
  75.  
  76.                   if ($children) { ?>
  77.  
  78.                   <ul class="moreinfo">
  79.                     <?php echo $children; ?>
  80.                   </ul>
  81.  
  82.                 <?php } ?>
  83.  
  84.             </article><!--end of moreinfo-->
  85.  
  86.             <article class="events">
  87.  
  88.                 <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar 1')) : ?> <?php endif; ?>
  89.  
  90.             </article><!--end of events-->
  91.  
  92. <?php } ?>
  93.  
  94. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment