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 option to allow for rectangular logos - fixes issue 1976 #2017

Closed
wants to merge 1 commit into from

Conversation

lamdayap
Copy link

@lamdayap lamdayap commented May 27, 2020

Fixes #
Issues with rectangular logos being resized into a square causing a squished look: #1976

Changes proposed in this Pull Request

I added an option to in the job_listings admin page will dynamically adjust the css height property for company logos to auto so that users can display a rectangular logo. I made this an option in admin so that users have a choice of enforcing square logos still as it does create a neater look

Testing instructions

Go into the job listing's settings page on Admin and toggle on the Rectangular logos option

Screenshot / Video

Screen Shot 2020-05-27 at 9 09 44 pm

Screen Shot 2020-05-27 at 9 10 51 pm

Copy link
Contributor

@alexsanford alexsanford left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! 🎉

I see a few issues that we'll need to resolve. Let me know what you think.

  • Since we're using LESS, it would be better not to duplicate all of that CSS code. Could we just override the height instead? Also, we'll need to commit the built CSS file as well.

  • When I test this, it seems like it's not only a CSS issue. Since we're using the thumbnail size, WordPress has already cropped it to 150x150. So even with this PR, I don't see the full (rectangular) image. I wonder if we need to use the medium size instead, and then resize it with CSS. What do you think? We should be able to do this by changing the call to get_the_company_logo( null, 'medium' ).

  • I'm not sure how I feel about this being a setting. Do you think a filter would be good enough? So users who want to activate this would be able to do something like this:

add_filter( 'job_manager_allow_rectangular_logos', '__return_true' );

@tripflex
Copy link
Collaborator

Thanks for submitting a PR! I agree with @alexsanford

The check should probably be moved into the_company_logo function, using a filter to check whether to enable it or not, and just add the appropriate class for the output. I say that because over the past 6+ years working for clients with WP Job Manager everyday, i've only been asked about this a handful of times, so I would assume it's a pretty edge case feature which would be best as a filter.

Many users and themes also override the template files so by doing this we move the functionality and support into the_company_logo function, so it will be compatible with customized template files and then we don't have to modify the default template file either.

Since get_the_company_logo accepts $size as second parameter should be fairly easy to do.

@onubrooks
Copy link
Contributor

Closing this as there's no activity here for a while.

@onubrooks onubrooks closed this Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants