Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

Added custom header support for the Theme #133

Closed
wants to merge 4 commits into from
Closed

Added custom header support for the Theme #133

wants to merge 4 commits into from

Conversation

mmaumio
Copy link
Contributor

@mmaumio mmaumio commented Oct 17, 2018

It added the checkbox to display the title/tagline as well.
Allowed users to upload a header image from the customer.
Allowed the option to change the Site Title and Description.
As It was present on the other Bundled themes.

WordPress.org Username: mmaumio

* @uses twentynineteen_header_style()
*/
function twentynineteen_custom_header_setup() {
add_theme_support( 'custom-header', apply_filters( 'twentynineteen_custom_header_args', array(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the following line to enable header video support. See #243:

'video' => true,

Copy link

@celloexpressions celloexpressions left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General comments and additional information for implementing video support per #243.

* Sample implementation of the Custom Header feature
* http://codex.wordpress.org/Custom_Headers
*
* You can add an optional custom header image to header.php like so ...

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment should probably be removed

@@ -0,0 +1,74 @@
<?php
/**
* Sample implementation of the Custom Header feature

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revise this comment

* @see twentynineteen_custom_header_setup().
*/
function twentynineteen_header_style() {
$header_text_color = get_header_textcolor();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend turning off support for the header text color. An overlay is provided to ensure readability. See also the discussions for Twenty Seventeen.

If header text color is a feature, it should be coordinated with the other color customization options instead of being implemented here.

@@ -22,6 +22,11 @@ function twentynineteen_body_classes( $classes ) {
$classes[] = 'hfeed';
}

// Add a class if there is a custom header.
if ( has_header_image() ) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revise to:
if ( has_header_image() || has_header_video() ) {

@@ -22,6 +22,11 @@ function twentynineteen_body_classes( $classes ) {
$classes[] = 'hfeed';
}

// Add a class if there is a custom header.
if ( has_header_image() ) {
$classes[] = 'has-header-image';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revise to:
$classes[] = 'has-header-media';

@@ -7,5 +7,37 @@
*/

( function( $ ) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend leaving any color customization or other changes to this file out of this PR, and coordinating those with the proposed color customization options.

height: auto;
}

.has-header-image .custom-header .wp-custom-header img {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the selector for header video.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which is probably:

.has-header-media .custom-header .wp-custom-header video

@@ -1259,14 +1259,36 @@ body.page .main-navigation {
/*--------------------------------------------------------------
## Header
--------------------------------------------------------------*/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this first:

.wp-custom-header iframe,
.wp-custom-header img,
.wp-custom-header video {
	display: block;
	height: auto;
	max-width: 100%;
}

@allancole allancole self-requested a review November 5, 2018 22:19
Copy link
Collaborator

@allancole allancole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this theme is primarily focused on Gutenberg, we don’t really want to add too many content-related customizer options. Instead we want to promote the Gutenberg editor as much as possible, so we’re utilizing featured images to achieve the header image behavior.

As always, we’re open to further discussion on this :-)

@joyously
Copy link

joyously commented Nov 5, 2018

I think this is good to have, regardless of the editor used.
But does it consider what image to show if there is a header image and a featured image?

@mmaumio
Copy link
Contributor Author

mmaumio commented Nov 6, 2018

So, are we keeping the custom header support off for now?
If not, please let me know if there's any enhancement I can do on the PR to get accepted.

@kjellr
Copy link
Collaborator

kjellr commented Nov 7, 2018

So, are we keeping the custom header support off for now?

Yes — as per @allancole's notes on focusing on Gutenberg, let's leave this out for now. I'll go ahead and close this.

Thank you for the PR in any case!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants