Advertisement
Guest User

Untitled

a guest
Nov 3rd, 2011
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.35 KB | None | 0 0
  1. <div id="side" <?php if (is_single()) echo 'style="margin-top:28px;"';?>>
  2. <?php $aboutpage = get_page_by_title(get_option('centita_about_pid'));?>
  3. <?php $servicespage = get_page_by_title(get_option('centita_services_pid'));?>
  4. <?php $contactpid = get_page_by_title(get_option('centita_contact_pid'));?>
  5.  
  6. <?php
  7. $children=wp_list_pages( 'echo=0&child_of=' . $post->ID . '&title_li=' );
  8. if ($children) {
  9. $parent = $post->ID;
  10. }else{
  11. $parent = $post->post_parent;
  12. if(!$parent){
  13. $parent = $post->ID;
  14. }
  15. }
  16. $children = wp_list_pages("title_li=&child_of=".$parent."&echo=0&depth=1&menu_order=sort_column");
  17. $parent_title = get_the_title($parent);
  18. ?>
  19. <?php if ($children) { ?>
  20. <div class="sidebox-top"></div>
  21. <div class="sidebox">
  22. <h3><?php echo $parent_title;?></h3>
  23. <ul class="about-list">
  24. <?php echo $children;?>
  25. </div>
  26. <?php
  27. }
  28. ?>
  29.  
  30. <?php if (is_home() || is_page_template('homepage-nivo.php')) { ?>
  31. <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Homepage Sidebar')) : endif; ?>
  32. <?php } else if (is_page_template('blog-template.php') || is_category() || is_search() || is_404()) {
  33. if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Blog Sidebar')) :
  34. if (function_exists('dynamic_sidebar') && dynamic_sidebar('General Sidebar')) : endif;
  35. endif;
  36. } else if (is_page($aboutpage->ID)) {
  37. if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('About Page')) :
  38. if (function_exists('dynamic_sidebar') && dynamic_sidebar('General Sidebar')) : endif;
  39. endif;
  40. } else if (is_page($servicespage->ID)) {
  41. if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Services Page')) :
  42. if (function_exists('dynamic_sidebar') && dynamic_sidebar('General Sidebar')) : endif;
  43. endif;
  44. } else if (is_single()) {
  45. if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Single Post')) :
  46. if (function_exists('dynamic_sidebar') && dynamic_sidebar('General Sidebar')) : endif;
  47. endif;
  48. } else if (is_page($contactpid->ID)) {
  49. if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Contact Sidebar')) :
  50. if (function_exists('dynamic_sidebar') && dynamic_sidebar('General Sidebar')) : endif;
  51. endif;
  52. } else {
  53. if (function_exists('dynamic_sidebar') && !dynamic_sidebar('General Sidebar')) : endif;
  54. }
  55. ?>
  56. </div><!-- end of side -->
  57.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement