catwingz

Longevity sidebar-banner.php

Mar 14th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.13 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Sidebar for the banner area
  4.  * @package Longevity
  5.  *  
  6.  */
  7.  
  8. $fpcurve = esc_attr(get_theme_mod( 'show_fpcurve', 1 ) ) ;
  9. $curve = esc_attr(get_theme_mod( 'show_curve', 1 ) ) ;
  10. $colourscheme = esc_attr(get_theme_mod( 'colour_scheme', 'default' ) ) ;
  11. $fplgcurve = esc_attr(get_theme_mod( 'fplg_curve', 1 ) ) ;
  12. $lgcurve = esc_attr(get_theme_mod( 'lg_curve', 1 ) ) ;
  13.  
  14. ?>
  15.  
  16. <?php // for the front page
  17.  if ( is_front_page()) : ?>
  18.  
  19.     <aside id="fp-banner" role="complementary">
  20.        
  21.         <?php // if a banner is active
  22.         if (  is_active_sidebar( 'banner' ) ) : ?>
  23.          
  24.                 <?php dynamic_sidebar( 'banner' );
  25.                 if( $fpcurve ) : // show or hide the curve on the front page
  26.                     if( $fplgcurve ) : // show the large curve on the front page
  27.                         echo '<div id="banner-curve"><img src="' . get_stylesheet_directory_uri()  . '/images/deckle-fp.png" alt="paper" /></div>';
  28.                        
  29.                     else :  // otherwise show the small one
  30.                         echo '<div id="banner-curve"><img src="' . get_stylesheet_directory_uri()  . '/images/deckle-page.png" alt="paper" /></div>';
  31.                     endif;
  32.                 endif;
  33.                 ?>
  34.                
  35.         <?php // if no banner is published
  36.         else : ?>
  37.        
  38.            <?php if( $curve ) : // show the curve when no banner is published
  39.                     echo '<div id="no-banner"></div>';
  40.                     echo '<div id="banner-curve"><img src="' . get_stylesheet_directory_uri()  . '/images/deckle-page.png' . $colourscheme . '.png" alt="paper" /></div>';
  41.                 else : // hide the curve if this is set and has no banner
  42.                     echo '<div id="no-banner" class="no-curve"></div>';                            
  43.             endif; ?>
  44.                
  45.         <?php endif; ?>
  46.        
  47.     </aside>
  48.  
  49. <?php // for inner pages
  50. else : ?>
  51.  
  52.         <aside id="page-banner" role="complementary">
  53.  
  54.         <?php // if a banner is active
  55.         if (  is_active_sidebar( 'banner' ) ) : ?>
  56.          
  57.                 <?php dynamic_sidebar( 'banner' );
  58.                 if( $curve ) : // show or hide the curves
  59.                     if( $lgcurve ) : // show the large curve on the front page
  60.                         echo '<div id="banner-curve"><img src="' . get_stylesheet_directory_uri()  . '/images/deckle-fp.png' . $colourscheme . '.png" alt="paper" /></div>';
  61.                     else :  // otherwise show the small one
  62.                         echo '<div id="banner-curve"><img src="' . get_stylesheet_directory_uri()  . '/images/deckle-page.png' . $colourscheme . '.png" alt="paper" /></div>';
  63.                     endif;
  64.                 endif;
  65.                 ?>
  66.                
  67.         <?php // if no banner is published
  68.         else : ?>
  69.        
  70.            <?php if( $curve ) : // show the curve when no banner is published
  71.                     echo '<div id="no-banner"></div>';
  72.                     echo '<div id="banner-curve"><img src="' . get_stylesheet_directory_uri()  . '/images/deckle-page.png' . $colourscheme . '.png" alt="paper" /></div>';
  73.                 else : // hide the curve if this is set and has no banner
  74.                     echo '<div id="no-banner" class="no-curve"></div>';                            
  75.             endif; ?>
  76.                
  77.         <?php endif; ?>
  78.          
  79.         </aside>
  80.  
  81. <?php endif; ?>
Add Comment
Please, Sign In to add comment