- This topic has 47 replies, 2 voices, and was last updated 6 years, 5 months ago by
Leo.
-
AuthorPosts
-
November 1, 2019 at 2:39 pm #1050853
Leo
StaffCustomer SupportMight be good to check with the plugin support to see if there is a good way to do this.
Generally that’s the best practice whcih is why the page builder container option exists in GP 🙂
November 4, 2019 at 9:03 am #1053014Carrie
Good morning, Theo! So one of the reasons I love your elements feature so much is that it can serve up different image sizes on mobile. It really helps with design.
Since we switched to using featured images, the alt tags are there, but the images are too small on mobile. What looks great on desktop does not look good at all on a phone. The height is too narrow to present well.
Is there a way to serve up a different featured image on mobile?
November 4, 2019 at 11:13 am #1053118Leo
StaffCustomer SupportYou can use the built-in
hide-onclasses and insert two images in the page hero content:
https://docs.generatepress.com/article/responsive-display/#using-our-hide-on-classesThe last example is what you are looking for.
November 4, 2019 at 11:29 am #1053143Carrie
You had me stop using the page hero, since it didn’t resize for larger width monitors, and had that white space underneath the image that we couldn’t seem to get rid of – so I changed all pages to featured images, as you suggested.
Is there a solution for this on featured images?
November 4, 2019 at 11:33 am #1053151Leo
StaffCustomer SupportSorry I forgot about that – thanks for the reminder 🙂
Not possible using the default featured image option unfortunately as it’s already responsive by default.
we would need to use the page hero option instead. Should be able to solve the white space at the bottom issue.
November 4, 2019 at 12:07 pm #1053183Carrie
Okay! Thanks, Leo. What do you need from me to help solve that white space issue?
I did confirm that the content container in WP Bakery has the top padding set to zero, the image itself does not have white space at the bottom of the image, and the “page builder container” is set to contained. I also have this in the CSS for the page:
Element class: .site-content { padding-top: 0 !important; }Here is a sample of how a sample page looks (with the mobile not set up yet):
https://www.carriemorgan.com/how-my-custom-keyword-research-works/November 4, 2019 at 12:09 pm #1053185Leo
StaffCustomer SupportTry this CSS:
.page-hero .inside-page-hero { line-height: 0; }November 4, 2019 at 12:19 pm #1053194Carrie
If I change Page Builder Container to default, that gap doubles in size, if that helps identify what is setting the space?
(I prefer to leave it in default, if possible, since setting it to container means I have to manually add in side padding to every container on every page.)
November 4, 2019 at 12:49 pm #1053214Carrie
That works! The whitespace is gone. Great job, Leo!!!!!!!!!!!!! #happydance
For the responsive display code, I didn’t see an example with two URLs, and the code below didn’t work. What am I doing wrong?
<img src=” https://www.carriemorgan.com/wp-content/uploads/how-custom-keyword-research-works-mobile.jpg
” style=”width:100%;” />November 4, 2019 at 12:51 pm #1053218Carrie
Whoops, let me try that again…
November 4, 2019 at 12:52 pm #1053219Carrie
Arghh… I’ll try it without the closing
November 4, 2019 at 12:55 pm #1053223Carrie
Sorry, can’t get the code in there for you to view. Let me try an image: https://www.carriemorgan.com/wp-content/uploads/GeneratePress-screenshot-5.jpg
November 4, 2019 at 3:52 pm #1053337Carrie
Never mind – I got the double URL code to work! Although there is a size where both images show up? It’s between desktop/tablet.
November 4, 2019 at 8:04 pm #1053445Leo
StaffCustomer SupportChoose the image you don’t want to use to show on tablet and add
hide-on-tabletclass to it.November 5, 2019 at 7:54 am #1053990Carrie
Isn’t it already in there if I have this?
div class=”hide-on-mobile”, URL, style width 100%, close div – then the second div class, “hide-on-desktop” “hide-on-tablet”, URL, style width 100%, close div
-
AuthorPosts
- You must be logged in to reply to this topic.