Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add image dimensions into header image customization #300

Closed
Tarun80 opened this issue Sep 10, 2016 · 9 comments
Closed

Add image dimensions into header image customization #300

Tarun80 opened this issue Sep 10, 2016 · 9 comments

Comments

@Tarun80
Copy link

@Tarun80 Tarun80 commented Sep 10, 2016

I'm proposing a minor addition to the header-main file. This would allow setting the image height and width to allow for pages to better pass Google Pagespeed tests.

Currently I have to manually edit them in to header-main.php - line 24:
<img class="site-image" src="<?php echo hu_get_img_src_from_option('header-image'); ?>" alt="<?php echo get_bloginfo('name'); ?>" width="200" height="64">

If it would be possible to do this through customizing the theme that would be fantastic.

Additionally, if you have the generic thumbnail for posts, image dimensions are also not shown and do appear as issues when you try to check against Google Pagespeed.

@Nikeo Nikeo added this to the v3.2.3 milestone Sep 11, 2016
@Nikeo

This comment has been minimized.

Copy link
Collaborator

@Nikeo Nikeo commented Sep 11, 2016

Thanks for the suggestion @Tarun80
Yes, the idea would be to get those dimensions from the wp attachment data and write them in the template.

@Nikeo

This comment has been minimized.

Copy link
Collaborator

@Nikeo Nikeo commented Sep 11, 2016

@Tarun80

This comment has been minimized.

Copy link
Author

@Tarun80 Tarun80 commented Oct 21, 2016

@Nikeo unfortunately that link does not work, returns a 404.

@eri-trabiccolo

This comment has been minimized.

Copy link
Contributor

@eri-trabiccolo eri-trabiccolo commented Oct 21, 2016

@Tarun80
You're right, that link worked till one week ago, then all the parts files (and many others) have been merged in one file.
Anyway, here you can find the piece of code Nicolas was referring to.
https://github.com/presscustomizr/customizr/blob/v3.4.19/inc/parts/class-header-header_main.php#L222

@Tarun80

This comment has been minimized.

Copy link
Author

@Tarun80 Tarun80 commented Oct 21, 2016

Thank you for that, @eri-trabiccolo

@Nikeo Nikeo modified the milestones: v3.2.10, v3.2.11 Nov 4, 2016
@Nikeo Nikeo modified the milestones: v3.2.11, v3.2.12 Dec 5, 2016
@Tarun80

This comment has been minimized.

Copy link
Author

@Tarun80 Tarun80 commented Jan 14, 2017

Any word on this?

@Nikeo Nikeo modified the milestones: v3.2.13, 3.3.13 Jun 23, 2017
@Nikeo Nikeo changed the title Add image dimensions into logo customization Add image dimensions into header image customization Jun 26, 2017
@Nikeo

This comment has been minimized.

Copy link
Collaborator

@Nikeo Nikeo commented Jun 26, 2017

Hi @Tarun80, with the current version of the theme, the header image is rendered with
a pluggable function : hu_render_header_image() located here : https://github.com/presscustomizr/hueman/blob/dev/functions/init-front.php#L308

@Nikeo

This comment has been minimized.

Copy link
Collaborator

@Nikeo Nikeo commented Jun 26, 2017

And that you can override in a child theme to add the dimensions attributes if needed.
Hope it helps

@Nikeo Nikeo closed this Jun 26, 2017
@Tarun80

This comment has been minimized.

Copy link
Author

@Tarun80 Tarun80 commented Jun 27, 2017

Is there no way you can add something to automatically detect and insert the image dimensions so that the theme passes validators?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.