????
Current Path : /home2/morganrand/backup.morganrand.com/wp-content/themes/wanderfuls/framework/ |
Current File : /home2/morganrand/backup.morganrand.com/wp-content/themes/wanderfuls/framework/overlays.php |
<?php /** * Create awesome overlays for image hovers * * @package Wanderfuls WordPress Theme * @subpackage Framework */ /** * Displays the Overlay HTML * * @since 1.0.0 */ if ( ! function_exists( 'tb_overlay' ) ) { function tb_overlay( $position = 'inside_link', $style = '', $args = array() ) { // If style is set to none lets bail if ( 'none' == $style ) { return; } // If style not defined get correct style based on theme_mods elseif ( ! $style ) { $style = tb_overlay_style(); } // If style is defined lets locate and include the overlay template if ( $style ) { // Load the overlay template $overlays_dir = 'partials/overlays/'; $template = $overlays_dir . $style .'.php'; $template = locate_template( $template, false ); // Only load template if it exists if ( $template ) { include( $template ); } } } } /** * Create an array of overlay styles so they can be altered via child themes * * @since 1.0.0 */ function tb_overlay_styles_array( $style = NULL ) { $array = array( '' => __( 'None', 'tb' ), 'hover-button' => __( 'Hover Button', 'tb' ), 'magnifying-hover' => __( 'Magnifying Glass Hover', 'tb' ), 'plus-hover' => __( 'Plus Icon Hover', 'tb' ), 'plus-two-hover' => __( 'Plus Icon #2 Hover', 'tb' ), 'plus-three-hover' => __( 'Plus Icon #3 Hover', 'tb' ), 'view-lightbox-buttons-buttons' => __( 'View/Lightbox Icons Hover', 'tb' ), 'view-lightbox-buttons-text' => __( 'View/Lightbox Text Hover', 'tb' ), 'title-bottom' => __( 'Title Bottom', 'tb' ), 'title-bottom-see-through' => __( 'Title Bottom See Through', 'tb' ), 'title-push-up' => __( 'Title Push Up', 'tb' ), 'title-excerpt-hover' => __( 'Title + Excerpt Hover', 'tb' ), 'title-category-hover' => __( 'Title + Category Hover', 'tb' ), 'title-category-visible' => __( 'Title + Category Visible', 'tb' ), 'title-date-hover' => __( 'Title + Date Hover', 'tb' ), 'title-date-visible' => __( 'Title + Date Visible', 'tb' ), 'slideup-title-white' => __( 'Slide-Up Title White', 'tb' ), 'slideup-title-black' => __( 'Slide-Up Title Black', 'tb' ), ); $array = apply_filters( 'tb_overlay_styles_array', $array ); return $array; } /** * Returns the overlay type depending on your theme options & post type * * @since 1.0.0 */ if ( ! function_exists( 'tb_overlay_style' ) ) { function tb_overlay_style( $style = '' ) { $style = $style ? $style : get_post_type(); if ( 'portfolio' == $style ) { $style = tb_get_mod( 'portfolio_entry_overlay_style' ); } elseif ( 'staff' == $style ) { $style = tb_get_mod( 'staff_entry_overlay_style' ); } return apply_filters( 'tb_overlay_style', $style ); } } /** * Returns the correct overlay Classname * * @since 1.0.0 */ if ( ! function_exists( 'tb_overlay_classes' ) ) { function tb_overlay_classes( $style = '' ) { // Return if style is none if ( 'none' == $style ) { return; } // Sanitize style $style = $style ? $style : tb_overlay_style(); // Return classes if ( $style ) { return 'overlay-parent overlay-parent-'. $style; } } }