Advertisement
Guest User

Untitled

a guest
Dec 4th, 2013
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.11 KB | None | 0 0
  1. /*  Dual sidebars? Get sidebar-2 template
  2. /* ------------------------------------ */
  3. if ( ! function_exists( 'alx_sidebar_dual' ) ) {
  4.    
  5.     function alx_sidebar_dual() {
  6.         global $post;
  7.        
  8.         if (
  9.             ( is_home() && (
  10.                 ( ot_get_option('layout-home') =='col-3cm' ) ||
  11.                 ( ot_get_option('layout-home') =='col-3cl' ) ||
  12.                 ( ot_get_option('layout-home') =='col-3cr' ) )
  13.             ) ||
  14.             ( is_single() && (
  15.                 ( ot_get_option('layout-single') =='col-3cm' ) ||
  16.                 ( ot_get_option('layout-single') =='col-3cl' ) ||
  17.                 ( ot_get_option('layout-single') =='col-3cr' ) )
  18.             ) ||
  19.             ( is_archive() && (
  20.                 ( ot_get_option('layout-archive') =='col-3cm' ) ||
  21.                 ( ot_get_option('layout-archive') =='col-3cl' ) ||
  22.                 ( ot_get_option('layout-archive') =='col-3cr' ) )
  23.             ) ||
  24.             ( is_category() && (
  25.                 ( ot_get_option('layout-archive-category') =='col-3cm' ) ||
  26.                 ( ot_get_option('layout-archive-category') =='col-3cl' ) ||
  27.                 ( ot_get_option('layout-archive-category') =='col-3cr' ) )
  28.             ) ||
  29.             ( is_search() && (
  30.                 ( ot_get_option('layout-search') =='col-3cm' ) ||
  31.                 ( ot_get_option('layout-search') =='col-3cl' ) ||
  32.                 ( ot_get_option('layout-search') =='col-3cr' ) )
  33.             ) ||
  34.             ( is_404() && (
  35.                 ( ot_get_option('layout-404') =='col-3cm' ) ||
  36.                 ( ot_get_option('layout-404') =='col-3cl' ) ||
  37.                 ( ot_get_option('layout-404') =='col-3cr' ) )
  38.             ) ||
  39.             ( is_page() && (
  40.                 ( ot_get_option('layout-page') =='col-3cm' ) ||
  41.                 ( ot_get_option('layout-page') =='col-3cl' ) ||
  42.                 ( ot_get_option('layout-page') =='col-3cr' ) )
  43.             )
  44.         )
  45.         { get_template_part('sidebar-2'); }
  46.        
  47.         elseif (
  48.             ( is_page() || is_single() ) && (
  49.             ( get_post_meta($post->ID,'_layout',true) == 'col-3cm' ) ||
  50.             ( get_post_meta($post->ID,'_layout',true) == 'col-3cl' ) ||
  51.             ( get_post_meta($post->ID,'_layout',true) == 'col-3cr' ) )
  52.         )
  53.         { get_template_part('sidebar-2'); }
  54.        
  55.         elseif (
  56.             ( ot_get_option('layout-global') =='col-3cm' ) ||
  57.             ( ot_get_option('layout-global') =='col-3cl' ) ||
  58.             ( ot_get_option('layout-global') =='col-3cr' )
  59.         )
  60.         { get_template_part('sidebar-2'); }
  61.     }
  62.    
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement