- This topic has 6 replies, 4 voices, and was last updated 3 years, 4 months ago by
Robert.
-
AuthorPosts
-
April 24, 2022 at 9:48 am #2198729
Robert
Can you please tell me how can I customize the page for no results found in the search? So if someone types something in the search field and there are no results on the website then a page is shown with “Nothing found” but that page brings my footer way up to the top and it looks bad.
April 24, 2022 at 11:07 am #2198766Ying
StaffCustomer SupportHi Robert,
So you want the footer stay at the bottom on no result page?
If so, you can add this CSS to your site:
@media (min-width: 769px) { .search-no-results .site-footer { position: fixed; width: 100%; bottom: 0; } }
Adding CSS: https://docs.generatepress.com/article/adding-css/
April 24, 2022 at 12:25 pm #2198806Robert
Hi,
I want it to stay at the bottom on every page that has not enough content to push it down, not just in the search page.
Kind regards,
RobertApril 24, 2022 at 6:16 pm #2198910Fernando Customer Support
Hi Robert,
On the contrary, if you would just like to make sure that the footer is at the bottom as opposed to making it sticky at the bottom, you can try this CSS instead:
div#page { min-height: calc(100vh - 265px); }
This CSS would make sure that the body takes up 100% view height minus the height of the footer and the header(which is 265px). You may also subtract the height of your ads as well if you prefer.
Hope this helps! Kindly let us know how it goes. 🙂
April 25, 2022 at 2:36 am #2199150Robert
Hello Fernando,
This is something closer to what I want but has to be done manually because I could have different sizes of footers on different pages.
I want the footer to stick to the bottom on the pages that have shorter content (like on the no results found search page).
This is an example of a page where the header should be on the bottom and it isn’t:
https://retetediabetici.ro/?mailpoet_page=subscriptions&mailpoet_router&endpoint=subscription&action=manage&data=eyJwcmV2aWV3IjoxfQThis is the example of the no results found search page where Ying solved my problem with the CSS code:
https://retetediabetici.ro/?s=generatepressI hope you can understand my need now.
Kind regards,
RobertApril 25, 2022 at 4:12 am #2199253David
StaffCustomer SupportHi there,
the only dynamic way without using Javascript is this:
@media(min-width: 769px) { body { display: flex; flex-direction: column; width: 100%; min-height: 100vh; } .site { flex: 1; } }
Problem you may have is your site is auto inserting adverts including one that is added to the footer that affects the
body
bottom padding so it may not work as you want it to because there are too many moving parts.April 25, 2022 at 4:32 am #2199271Robert
Duplicate. We continue on the other post.
-
AuthorPosts
- You must be logged in to reply to this topic.