sidebar.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?php
  2. if ( !defined('ABSPATH') ){ die(); }
  3. global $avia_config;
  4. ##############################################################################
  5. # Display the sidebar
  6. ##############################################################################
  7. $default_sidebar = true;
  8. $sidebar_pos = avia_layout_class('main', false);
  9. $sidebar_smartphone = avia_get_option('smartphones_sidebar') == 'smartphones_sidebar' ? 'smartphones_sidebar_active' : "";
  10. $sidebar = "";
  11. if(strpos($sidebar_pos, 'sidebar_left') !== false) $sidebar = 'left';
  12. if(strpos($sidebar_pos, 'sidebar_right') !== false) $sidebar = 'right';
  13. //filter the sidebar position (eg woocommerce single product pages always want the same sidebar pos)
  14. $sidebar = apply_filters('avf_sidebar_position', $sidebar);
  15. //if the layout hasnt the sidebar keyword defined we dont need to display one
  16. if(empty($sidebar)) return;
  17. if(!empty($avia_config['overload_sidebar'])) $avia_config['currently_viewing'] = $avia_config['overload_sidebar'];
  18. echo "<aside class='sidebar sidebar_".$sidebar." ".$sidebar_smartphone." ".avia_layout_class( 'sidebar', false )." units' ".avia_markup_helper(array('context' => 'sidebar', 'echo' => false)).">";
  19. echo "<div class='inner_sidebar extralight-border'>";
  20. //Display a subnavigation for pages that is automatically generated, so the users do not need to work with widgets
  21. $av_sidebar_menu = avia_sidebar_menu(false);
  22. if($av_sidebar_menu)
  23. {
  24. echo $av_sidebar_menu;
  25. $default_sidebar = false;
  26. }
  27. $the_id = @get_the_ID();
  28. $custom_sidebar = "";
  29. if(!empty($the_id) && is_singular())
  30. {
  31. $custom_sidebar = get_post_meta($the_id, 'sidebar', true);
  32. }
  33. $custom_sidebar = apply_filters('avf_custom_sidebar', $custom_sidebar);
  34. if($custom_sidebar)
  35. {
  36. dynamic_sidebar($custom_sidebar);
  37. $default_sidebar = false;
  38. }
  39. else
  40. {
  41. if(empty($avia_config['currently_viewing'])) $avia_config['currently_viewing'] = 'page';
  42. // general shop sidebars
  43. if ($avia_config['currently_viewing'] == 'shop' && dynamic_sidebar('Shop Overview Page') ) : $default_sidebar = false; endif;
  44. // single shop sidebars
  45. if ($avia_config['currently_viewing'] == 'shop_single') $default_sidebar = false;
  46. if ($avia_config['currently_viewing'] == 'shop_single' && dynamic_sidebar('Single Product Pages') ) : $default_sidebar = false; endif;
  47. // general blog sidebars
  48. if ($avia_config['currently_viewing'] == 'blog' && dynamic_sidebar('Sidebar Blog') ) : $default_sidebar = false; endif;
  49. // general pages sidebars
  50. if ($avia_config['currently_viewing'] == 'page' && dynamic_sidebar('Sidebar Pages') ) : $default_sidebar = false; endif;
  51. // forum pages sidebars
  52. if ($avia_config['currently_viewing'] == 'forum' && dynamic_sidebar('Forum') ) : $default_sidebar = false; endif;
  53. }
  54. //global sidebar
  55. if (dynamic_sidebar('Displayed Everywhere')) : $default_sidebar = false; endif;
  56. //default dummy sidebar
  57. if (apply_filters('avf_show_default_sidebars', $default_sidebar))
  58. {
  59. if(apply_filters('avf_show_default_sidebar_pages', true)) {avia_dummy_widget(2);}
  60. if(apply_filters('avf_show_default_sidebar_categories', true)) {avia_dummy_widget(3);}
  61. if(apply_filters('avf_show_default_sidebar_archiv', true)) {avia_dummy_widget(4);}
  62. // customize default sidebar and add your sidebars
  63. do_action ('ava_add_custom_default_sidebars');
  64. }
  65. ?>
  66. <?php
  67. $emp = get_post_meta( get_the_ID(), '_id_emp', true );
  68. $tag_id = get_queried_object()->term_id;
  69. if ( 'Employed by Self Regional Healthcare.' === $emp AND $tag_id !==127 ) {
  70. ?>
  71. <div class='avia-button-wrap avia-button-center avia-builder-el-34 el_after_av_button el_before_av_button'><a href='http://www.selfregional.org/new-patient-forms/' class='avia-button avia-icon_select-yes-left-icon avia-color-srh-blue avia-size-large avia-position-left ' ><span class='avia_button_icon avia_button_icon_left ' aria-hidden='true' data-av_icon='' data-av_iconfont='entypo-fontello'></span><span style="color:#fff" class='avia_iconbox_title' >Download New Patient Forms</span></a></div>
  72. <?php
  73. }
  74. ?>
  75. <a href="https://mychart.selfregional.org/mychart/"><img src="<?php echo get_stylesheet_directory_uri() ?>/img/mychart.gif"></a>
  76. <?php
  77. echo "</div>";
  78. echo "</aside>";