Permalink
Browse files

Mejorada la salida HTML para #static-header. Nuevo filtro t_em_filter…

…_hero_header_style
  • Loading branch information...
rogertm committed Jan 9, 2019
1 parent afb47c7 commit c3ac7ee4317178d44e097ff744547a0c3e2b325e
@@ -1,12 +1,13 @@
== Changelog ==

= 1.4.0 =
Release Date: January 07, 2019
* Added: Filters t_em_filter_template_archive_query_args, t_em_filter_template_blog_content_query_args, t_em_filter_template_blog_excerpt_query_args, t_em_filter_template_contributors_args
Release Date: January 09, 2019
* Added: Filters t_em_filter_template_archive_query_args, t_em_filter_template_blog_content_query_args, t_em_filter_template_blog_excerpt_query_args, t_em_filter_template_contributors_args, t_em_filter_hero_header_style
* Enhancement: HTML > Front Page Widgets > Template Jumbotron: Make a better semantic markup
* Enhancement: HTML > Front Page Widgets > Template Features: Make a better semantic markup
* Enhancement: HTML > Colophon > Manage all widgets markup by classes, not by ids
* Enhancement: HTML > Site Info > Manage all markup by classes, not by ids
* Enhancement: HTML > Header > Manage all markup by classes, not by ids

Release Date: September 21, 2018
* Enhancement: Use jQuery, Bootstrap, CountdownTimer and Icon Pack as dependencies from npmjs.com
@@ -5737,12 +5737,12 @@ button#maintenance-mode-alert:focus {
.mh-100 {
max-height: 100% !important; }

.m-0, #header #static-header {
.m-0, #static-header {
margin: 0 !important; }

.mt-0,
.my-0,
#header #static-header.static-header-hero #static-header-text {
#static-header.hero-header .hero-body {
margin-top: 0 !important; }

.mr-0,
@@ -5751,7 +5751,7 @@ button#maintenance-mode-alert:focus {

.mb-0,
.my-0,
#header #static-header.static-header-hero #static-header-text {
#static-header.hero-header .hero-body {
margin-bottom: 0 !important; }

.ml-0,
@@ -5801,8 +5801,8 @@ button#maintenance-mode-alert:focus {

.mt-3, article,
.my-3,
#header #static-header #static-header-image,
#header #static-header #static-header-text,
#static-header.jumbotron .hero-thumbnail,
#static-header.jumbotron .hero-body,
.page-links,
article .card-body .btn,
article .card-body #commentform .submit,
@@ -5827,8 +5827,8 @@ article .card-img-overlay #comments #cancel-comment-reply-link,

.mb-3, .gallery .gallery-item, article .featured-post-thumbnail, article .entry-excerpt, article .author-info, article .card, .call-action, #maintenance-mode #countdowntimer,
.my-3,
#header #static-header #static-header-image,
#header #static-header #static-header-text,
#static-header.jumbotron .hero-thumbnail,
#static-header.jumbotron .hero-body,
.page-links,
article .card-body .btn,
article .card-body #commentform .submit,
@@ -5993,7 +5993,7 @@ article .card-img-overlay #comments #cancel-comment-reply-link,

.pt-5,
.py-5,
#header #static-header.static-header-hero #static-header-text {
#static-header.hero-header .hero-body {
padding-top: 3rem !important; }

.pr-5,
@@ -6002,7 +6002,7 @@ article .card-img-overlay #comments #cancel-comment-reply-link,

.pb-5,
.py-5,
#header #static-header.static-header-hero #static-header-text {
#static-header.hero-header .hero-body {
padding-bottom: 3rem !important; }

.pl-5, #comments .children,
@@ -7142,10 +7142,10 @@ a.text-warning:hover, a.text-warning:focus {
a.text-danger:hover, #commentform a.required:hover, a.text-danger:focus, #commentform a.required:focus {
color: #bd2130 !important; }

.text-light, #header #static-header.static-header-hero #static-header-text, .call-action, #maintenance-mode-alert a {
.text-light, #static-header.hero-header .hero-body, .call-action, #maintenance-mode-alert a {
color: #f8f9fa !important; }

a.text-light:hover, #header #static-header.static-header-hero a#static-header-text:hover, a.call-action:hover, #maintenance-mode-alert a:hover, a.text-light:focus, #header #static-header.static-header-hero a#static-header-text:focus, a.call-action:focus, #maintenance-mode-alert a:focus {
a.text-light:hover, #static-header.hero-header a.hero-body:hover, a.call-action:hover, #maintenance-mode-alert a:hover, a.text-light:focus, #static-header.hero-header a.hero-body:focus, a.call-action:focus, #maintenance-mode-alert a:focus {
color: #dae0e5 !important; }

.text-dark {
@@ -8756,12 +8756,13 @@ a .featured-post-thumbnail:hover, a .featured-post-thumbnail:focus {
#header #header-image .container img {
width: 100%;
height: auto; }

@media (min-width: 992px) {
#header #static-header.static-header-text-left #static-header-image {
#static-header.static-header-text-left .container .row > div:first-child {
order: 12; }
#header #static-header.static-header-text-left #static-header-text {
#static-header.static-header-text-left .container .row > div:last-child {
order: 1; } }
#header #static-header.static-header-hero #static-header-inner {
#static-header.hero-header {
background-repeat: no-repeat;
background-size: cover;
background-color: #adb5bd; }

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -192,37 +192,37 @@ figure{
@extend .p-0;
}
}
#static-header{
@extend .m-0;
#static-header-image,
#static-header-text{
}
#static-header{
@extend .m-0;
&.jumbotron{
.hero-thumbnail,
.hero-body{
@extend .my-3;
}
@include media-breakpoint-up(lg){
}
@include media-breakpoint-up(lg){
&.static-header-text-left{
#static-header-image{
order: 12;
}
#static-header-text{
order: 1;
}
.container .row > div:first-child{
order: 12;
}
}
&.static-header-hero{
#static-header{
&-inner{
background-repeat: no-repeat;
background-size: cover;
background-color: $gray-500;
}
&-text{
@extend .my-0;
@extend .py-5;
@extend .text-light;
}
.container .row > div:last-child{
order: 1;
}
}
}
&.hero-header{
background:{
repeat: no-repeat;
size: cover;
color: $gray-500;
}
.hero-body{
@extend .my-0;
@extend .py-5;
@extend .text-light;
}
}
}

//
@@ -17,7 +17,7 @@
* Display Hero template for static header
*/
?>
<section id="static-header" class="<?php echo t_em( 'static_header_template' ) ?>" role="info">
<section id="static-header" class="hero-header hero <?php echo t_em( 'static_header_template' ) ?>" role="info">
<?php
/**
* Fires before the static header section. Full width;
@@ -26,7 +26,12 @@
*/
do_action( 't_em_action_static_header_before' );
?>
<div id="static-header-inner">
<?php if ( t_em( 'static_header_headline' )
|| t_em( 'static_header_content' )
|| ( t_em( 'static_header_primary_button_text' ) && t_em( 'static_header_primary_button_link' ) )
|| ( t_em( 'static_header_secondary_button_text' ) && t_em( 'static_header_secondary_button_link' ) )
) : ?>
<div class="<?php t_em_container() ?>">
<?php
/**
* Fires in and before the static header section. Full width;
@@ -35,19 +40,14 @@
*/
do_action( 't_em_action_static_header_inner_before' );
?>
<?php if ( t_em( 'static_header_headline' )
|| t_em( 'static_header_content' )
|| ( t_em( 'static_header_primary_button_text' ) && t_em( 'static_header_primary_button_link' ) )
|| ( t_em( 'static_header_secondary_button_text' ) && t_em( 'static_header_secondary_button_link' ) )
) : ?>
<div id="static-header-text" class="<?php t_em_container() ?>">
<div class="hero-body">
<?php if ( t_em( 'static_header_headline' ) ) : ?>
<header><h2><?php echo t_em( 'static_header_headline' ); ?></h2></header>
<h2 class="hero-heading"><?php echo t_em( 'static_header_headline' ); ?></h2>
<?php endif; ?>
<?php if ( t_em( 'static_header_content' ) ) : ?>
<div class="static-header-content"><?php echo t_em_wrap_paragraph( t_em( 'static_header_content' ) ); ?></div>
<?php echo t_em_wrap_paragraph( t_em( 'static_header_content' ) ); ?>
<?php endif; ?>
<footer class="actions">
<footer class="hero-footer">
<?php if ( ( t_em( 'static_header_primary_button_text' ) && t_em( 'static_header_primary_button_link' ) ) ) : ?>
<a href="<?php echo t_em( 'static_header_primary_button_link' ); ?>"
class="btn btn-primary">
@@ -62,9 +62,8 @@ class="btn btn-secondary">
<span class="button-text"><?php echo t_em( 'static_header_secondary_button_text' ); ?></span>
</a>
<?php endif; ?>
</footer><!-- .actions -->
</div><!-- #static-header-text -->
<?php endif; ?>
</footer>
</div>
<?php
/**
* Fires in and after the static header section. Full width;
@@ -73,7 +72,8 @@ class="btn btn-secondary">
*/
do_action( 't_em_action_static_header_inner_after' );
?>
</div>
</div>
<?php endif; ?>
<?php
/**
* Fires after the static header section. Full width;
@@ -17,8 +17,7 @@
* Display Jumbotron template for static header
*/
?>
<section id="static-header" class="jumbotron <?php echo t_em( 'static_header_template' ) ?>" role="info">
<div class="<?php t_em_container(); ?>">
<section id="static-header" class="jumbotron hero <?php echo t_em( 'static_header_template' ) ?>" role="info">
<?php
/**
* Fires before the static header section. Full width;
@@ -27,7 +26,7 @@
*/
do_action( 't_em_action_static_header_before' );
?>
<div id="static-header-inner" class="row">
<div class="<?php t_em_container(); ?>">
<?php
/**
* Fires in and before the static header section. Full width;
@@ -36,26 +35,28 @@
*/
do_action( 't_em_action_static_header_inner_before' );
?>
<div class="row">
<?php if ( ! empty ( t_em( 'static_header_img_src' ) ) ) : ?>
<div id="static-header-image" <?php t_em_breakpoint( 'static-header' ); ?>>
<div <?php t_em_breakpoint( 'static-header' ); ?>>
<img src="<?php echo t_em( 'static_header_img_src' ); ?>"
alt="<?php echo sanitize_text_field( t_em( 'static_header_headline' ) ); ?>">
</div><!-- #static-header-image -->
class="hero-thumbnail" alt="<?php echo sanitize_text_field( t_em( 'static_header_headline' ) ); ?>">
</div>
<?php endif; ?>

<?php if ( t_em( 'static_header_headline' )
|| t_em( 'static_header_content' )
|| ( t_em( 'static_header_primary_button_text' ) && t_em( 'static_header_primary_button_link' ) )
|| ( t_em( 'static_header_secondary_button_text' ) && t_em( 'static_header_secondary_button_link' ) )
) : ?>
<div id="static-header-text" <?php t_em_breakpoint( 'static-header' ); ?>>
<div <?php t_em_breakpoint( 'static-header' ); ?>>
<div class="hero-body">
<?php if ( t_em( 'static_header_headline' ) ) : ?>
<header><h2><?php echo t_em( 'static_header_headline' ); ?></h2></header>
<h2 class="hero-heading"><?php echo t_em( 'static_header_headline' ); ?></h2>
<?php endif; ?>
<?php if ( t_em( 'static_header_content' ) ) : ?>
<div class="static-header-content"><?php echo t_em_wrap_paragraph( t_em( 'static_header_content' ) ); ?></div>
<?php echo t_em_wrap_paragraph( t_em( 'static_header_content' ) ); ?>
<?php endif; ?>
<footer class="actions">
<footer class="hero-footer">
<?php if ( ( t_em( 'static_header_primary_button_text' ) && t_em( 'static_header_primary_button_link' ) ) ) : ?>
<a href="<?php echo t_em( 'static_header_primary_button_link' ); ?>"
class="btn btn-primary">
@@ -70,9 +71,11 @@ class="btn btn-secondary">
<span class="button-text"><?php echo t_em( 'static_header_secondary_button_text' ); ?></span>
</a>
<?php endif; ?>
</footer><!-- .actions -->
</div><!-- #static-header-text -->
</footer>
</div>
</div>
<?php endif; ?>
</div>
<?php
/**
* Fires in and after the static header section. Full width;
@@ -81,7 +84,7 @@ class="btn btn-secondary">
*/
do_action( 't_em_action_static_header_inner_after' );
?>
</div>
</div>
<?php
/**
* Fires after the static header section. Full width;
@@ -90,5 +93,4 @@ class="btn btn-secondary">
*/
do_action( 't_em_action_static_header_after' );
?>
</div>
</section><!-- #static-header .container -->
@@ -245,10 +245,21 @@ function t_em_static_header_bg(){
return;
if ( ! t_em( 'static_header_img_src' ) )
return;
$style = array(
'background-image: url( '. t_em( 'static_header_img_src' ) .' );',
);
/**
* Filter the .hero-header style
*
* @param array $style CSS style in an array form
* @since Twenty'em 1.4.0
*/
$style = apply_filters( 't_em_filter_hero_header_style', join( $style ) );
?>
<style type="text/css">
#static-header-inner{
background-image: url( <?php echo t_em( 'static_header_img_src' ); ?> );
#static-header.hero-header{
<?php echo $style; ?>
}
</style>
<?php

0 comments on commit c3ac7ee

Please sign in to comment.