Permalink
Browse files

t_em_static_header_bg() Pluggable y agregado el parámetro $offset a t…

…_em_grid()
  • Loading branch information...
rogertm committed Sep 13, 2018
1 parent d3e02e8 commit 5ef8b01bfb75715f2787677cc6a460a881e9be09
Showing with 10 additions and 4 deletions.
  1. +7 −3 inc/functions.php
  2. +3 −1 templates/header.php
View
@@ -223,11 +223,15 @@ function t_em_breakpoint( $section ){
/**
* Grid breakpoint
* @param string $cols Columns
* @param string $breakpoint breakpoint. Default 'lg'
* @param string $breakpoint Breakpoint. Default 'lg'
* @param boolean $offset Offset. If 'true' columns will be offset. Default 'false'
* @return string CSS class. 'col-$breakpoint-$cols' or 'offset-$breakpoint-$cols' if
* $offset is set to true
*
* @since Twenty'em 1.2
* @since Twenty'em 1.4.0 Added parameter $offset
*/
function t_em_grid( $cols, $breakpoint = '' ){
function t_em_grid( $cols, $breakpoint = '', $offset = false ){
/**
* Filter the default breakpoint
* @param string $breakpoint Default breakpoint
@@ -236,7 +240,7 @@ function t_em_grid( $cols, $breakpoint = '' ){
*/
$bp = ( ! $breakpoint ) ? apply_filters( 't_em_filter_default_breakpoint', 'lg' ) : $breakpoint;
$sep = ( $bp ) ? '-' : null;
$class = 'col-'. $bp . $sep . $cols;
$class = ( ( $offset ) ? 'offset-' : 'col-' ) . $bp . $sep . $cols;
return $class;
}
View
@@ -234,8 +234,9 @@ function t_em_static_header(){
endif; // function t_em_static_header()
add_action( 't_em_action_header', 't_em_static_header', 5 );
if ( ! function_exists( 't_em_static_header_bg' ) ) :
/**
* Get and set the background image for the Hero Header
* Pluggable Function: Get and set the background image for the Hero Header
*
* @since Twenty'em 1.3.1
*/
@@ -252,5 +253,6 @@ function t_em_static_header_bg(){
</style>
<?php
}
endif;
add_action( 'wp_head', 't_em_static_header_bg' );
?>

0 comments on commit 5ef8b01

Please sign in to comment.