Advertisement
pratikshrestha

Catch Box Sidebar Issue

Apr 16th, 2016
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.21 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The Sidebar containing the main widget area.
  4.  *
  5.  * @package Catch Themes
  6.  * @subpackage Catch Box
  7.  * @since Catch Box 1.0
  8.  */
  9. ?>
  10.  
  11. <?php
  12. /**
  13.  * catchbox_above_secondary hook
  14.  */
  15. do_action( 'catchbox_above_secondary' );
  16.  
  17. $layout = catchbox_get_theme_layout();
  18.  
  19. if ( $layout == 'no-sidebar-one-column' || $layout == 'no-sidebar' || is_page_template( 'page-disable-sidebar.php' ) || is_page_template( 'page-fullwidth.php' ) || is_page_template( 'page-onecolumn.php' ) ) :
  20.     return false;
  21. else :
  22. ?>
  23.         <aside id="secondary" class="sidebar widget-area" role="complementary">
  24.             <h1 class="screen-reader-text"><?php _e( 'Primary Sidebar Widget Area', 'catch-box' ); ?></h1>
  25.             <?php if ( ! dynamic_sidebar( 'sidebar-1' ) ) :
  26.                 //Helper Text
  27.                 if ( current_user_can( 'edit_theme_options' ) ) { ?>
  28.                     <section id="widget-default-text" class="widget widget_text">
  29.                         <h2 class="widget-title"><?php _e( 'Primary Sidebar Widget Area', 'catch-box' ); ?></h2>
  30.                         <div class="textwidget">
  31.                             <p><?php _e( 'This is the Primary Sidebar Widget Area if you are using a two column site layout option.', 'catch-box' ); ?></p>
  32.                             <p><?php printf( __( 'By default it will load Search and Archives widgets as shown below. You can add widget to this area by visiting your <a href="%s">Widgets Panel</a> which will replace default widgets.', 'catch-box' ), esc_url( admin_url( 'widgets.php' ) ) ); ?></p>
  33.                         </div>
  34.                     </section><!-- #widget-default-text -->
  35.                 <?php
  36.                 } ?>
  37.                 <section id="archives" class="widget">
  38.                     <h2 class="widget-title"><?php _e( 'Archives', 'catch-box' ); ?></h2>
  39.                     <div class="widget-content">
  40.                         <ul>
  41.                             <?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>
  42.                         </ul>
  43.                     </div>
  44.                 </section>
  45.  
  46.                 <section id="default-search" class="widget widget_search">
  47.                     <?php get_search_form(); ?>
  48.                 </section>
  49.  
  50.             <?php endif; // end sidebar widget area ?>
  51.         </aside><!-- #secondary .widget-area -->
  52. <?php endif;
  53.  
  54. /**
  55.  * catchbox_below_secondary hook
  56.  */
  57. do_action( 'catchbox_below_secondary' ); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement