Advertisement
vailobox

Layers Custom Conditional Title

Jun 15th, 2015
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.42 KB | None | 0 0
  1. <?php
  2. /**
  3.  * This partial is used for displaying the Site Header when in archive pages
  4.  *
  5.  * @package Layers
  6.  * @since Layers 1.0.0
  7.  */
  8. global $layers_page_title_shown;
  9. $layers_page_title_shown = 1;
  10.  
  11. /**
  12. * Fetch the site title array
  13. */
  14. $details = layers_get_page_title();
  15. if(is_front_page() && is_page('shop')){ ?>
  16. <div class="title-container">
  17.         <div class="title">
  18.                 <h3 class="heading"><?php _e('Shop', 'layerswp'); ?></h3>
  19.         </div>
  20.  
  21.     </div>
  22. <?php  } else {
  23. if( isset( $details[ 'title' ] ) || isset( $details[ 'excerpt' ] ) ) { ?>
  24.     <div <?php layers_wrapper_class( 'title_container', 'title-container' ); ?>>
  25.         <?php do_action('layers_before_header_page_title'); ?>
  26.         <div class="title">
  27.             <?php /**
  28.             * Display Breadcrumbs
  29.             */
  30.             layers_bread_crumbs();
  31.  
  32.             if( isset( $details[ 'title' ] ) && '' != $details[ 'title' ] ) { ?>
  33.                 <?php do_action('layers_before_title_heading'); ?>
  34.                 <h3 class="heading"><?php echo $details[ 'title' ]; ?></h3>
  35.                 <?php do_action('layers_after_title_heading'); ?>
  36.             <?php } // if isset $title
  37.  
  38.             if( isset( $details[ 'excerpt' ] ) && '' != $details[ 'excerpt' ] ) { ?>
  39.                 <?php do_action('layers_before_title_excerpt'); ?>
  40.                 <p class="excerpt"><?php echo $details[ 'excerpt' ]; ?></p>
  41.                 <?php do_action('layers_after_title_excerpt'); ?>
  42.             <?php } // if isset $excerpt ?>
  43.         </div>
  44.         <?php do_action('layers_after_header_page_title'); ?>
  45.     </div>
  46. <?php }
  47. } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement