Customize Mobile Responsiveness of Lifestyle Pro Theme Header

In this tutorial, i’ll show you one way to remove all the padding and margins for the Lifestyle Pro themes header.

Update: Here’s a better solution tested on the latest version of Lifestyle Pro Responsive Full Header Image

This post is an extension of a previous post about how to Customize Lifestyle Pro Theme Header Image Area.

We”ll cover both the:

  1. Default header image size
  2. Using the full width header

Default Header Image Size

This solution assumes you’re using the default header image size of 320 × 110 pixels.

default custom header

And here’s the front end:

front end header

This is what it will look like on smaller screens.

@543 px

ipad view

@216 px

iphone size

Change Background Color

To change the background color, simply add this code at the end of your child themes style.css file.

.site-header {
    background-color: #fff;
}

Remove Padding & Margins On Smaller Screens

Simply paste this CSS code after your Media Queries at the end of your child themes style.css file.


/*
Custom Media Queries 
------------------------------------------------------------ */

@media only screen and (max-width: 1023px) {  

.header-image .site-title a {
		background-position: center !important;
		margin: 0 0 16px;
		margin: 0 0 1.6rem;
	}
	
	.site-header {
		padding: 0px;
		padding: 0rem;
	}
	
	.site-header .widget-area {
		margin-top: 16px;
		margin-top: 1.6rem;
	}

	.site-header .search-form {
		margin: 16px auto ;
		margin: 1.6rem auto;
	}

}	
	
@media only screen and (max-width: 767px) {  
	
.header-image .site-title a {
	padding: 0;
	margin: 0;
	}	
	
	.header-full-width.header-image .site-title a {
    background-position: 0;
    margin: 0;
    }
	
	.site-header {
    background-color: #fff;
    overflow: hidden;
    padding: 0;
    }

.site-container {
    background-color: #FFFFFF;
    box-shadow: 0 0 5px #DDDDDD;
    margin: 0 auto;
    max-width: 1140px;
    overflow: hidden;
    padding: 0;
    }
	
	.site-inner {
    clear: both;
    padding: 0;
    }
	
}

Remove CSS Code From Line 1896

Remove this code from Line 1896 of your child themes style.css file in this Media Queries section: @media only screen and (max-width: 767px) {

.header-image .site-title a {
		background-size: contain !important;
	}

And here’s the result.

@564px

ipad

@298px

iphone

Full Width Header

Here’s an example of what a full width header looks like without removing any padding or margins:

full width header

This is how the above code makes a full width header which is 1140px X 200px look on smaller screens:

@764px

764px width

@673px

smaller screen

@315px

iphone - Full width header

I hope that gives you a better understanding of the different ways you can customize your header image to display differently when viewed on different sized mobile devices when using the Lifestyle Pro theme by StudioPress.

Different Images At Different Screen Widths

If you want to display different images on different mobile devices, here’s a tutorial which shows you how.

Related Tutorials


Comments

18 responses to “Customize Mobile Responsiveness of Lifestyle Pro Theme Header”

  1. Svend Thorhauge Avatar
    Svend Thorhauge

    Hi,

    Thank a lot for your tutorial. I embedded your suggestions and it looks beautiful on my laptop, my I do have some issues with the responsiveness.

    1) I’ve made the header 1068×379 (Otherwise I had some cutting in the ends).

    2) on small screens (i.e. iPhone) the container is still 379 and thereby giving a lot of space in top and below.

    What am I doing wrong?

    All he best

    Svend T.

    1. Brad Dalton Avatar
      Brad Dalton

      You will need to tweak the Media Queries at different screen sizes to get it to look the way you want with your custom header image size.

    2. Rambo Ruiz Avatar

      Have you already found the solution to this? I followed the steps shared by Brad and it worked well but I still am having the same issue as you are, my header is cut to both sides.

  2. Lixation Avatar

    Hi Brad,

    I followed all these steps but the mobile version of my header is still huge. I am using a 1140 x 297 header, so which part of the code do I need to change?

    Thank you

    1. Brad Dalton Avatar
      Brad Dalton

      The Media Queries in your style sheet.

  3. Brad,

    I’ve done everything you list and have the header the way I want except for on my iphone, its cutting it on each side.

    I added this code to the bottom of my css:

    @media only screen and (max-width: 767px) {
    .site-header {
    background-image: url(images/MYIMAGE.png);
    }
    }

    I’m not sure what I’m doing wrong, any ideas?

    I’m ok with having a second smaller version showing up, its just not working for me lol thanks so much!

  4. Thanks a lot for this tutorial Brad, it works fine!

    1. Brad Dalton Avatar
      Brad Dalton

      Good stuff!

  5. Perfect explanation! Thank you for taking the time to do this.

    1. Brad Dalton Avatar
      Brad Dalton

      Thanks Kristine.

  6. Sorry, forgot to mention, the padding is removed from the mobile site – yay – but the header image is not showing properly… it only shows a bit of one of the photos. How do I get it to show the whole header on mobile?

    1. Brad Dalton Avatar
      Brad Dalton

      Hard to say as you must have a problem with the CSS in your Media Queries. Would need to look at the code to work out the solution.

    2. Daidri Smythe Avatar
      Daidri Smythe

      I was wondering if Julie had found a solution. I hadn’t touched my Media Queries section before adding the code you suggested at the bottom and then deleting the one code you said to delete. My full size header looks perfect on my ipad but is cut short on the width on my iphone. Figuring since two of us are having the same issure that there may be another suggestion.
      Thanks so much! Daidri

  7. Hi Brad,

    This is exactly what I have been looking to do. I have followed your tutorial to remove the padding, and my image is 1140×200. I must be missing a step as it is not removing any of the padding when looking at it on my mac computer. I have added the custom media queries and removed the two code areas.

    Thanks! Julie

  8. Dan Cronin Avatar
    Dan Cronin

    Is there any way to use a different image altogether on an phone screen. I tried the Genesis Responsive Header plugin and it did not do anything for the Lifestyle theme. In Bootstrap, using a different image for tablets and phones is quite easy to accomplish. It’s just not practical to use the same image on both an iPhone and a full size screen. It’s going to look awful on one or the other. Any suggestions you can provide would be most welcome.

    p.s., your earlier tutorial about using a full size image in the Lifestyle theme’s header worked beautifully.

    1. Brad Dalton Avatar
      Brad Dalton

      Hello Dan

      Simply add it to the media queries for the screen size you want at the end of your style sheet.

      Or, you can install a mobile plugin which adds a conditional tags for a range of specific devices and add it that way.

      Example:
      [code]
      @media only screen and (max-width: 767px) {
      .site-header {
      background-image: url(images/second-header.png);
      }
      }
      [/code]

      You can change the 767 to any size you like and add multiple header images which are the same size as the max width. Tested this and works well however you will need to reduce or remove the padding and/or margins which apply to the header.

      1. Ok. I have combed over this for the past few hours. I feel like I tried everything. I made custom made images of widths 1023, 767, and 320. I copy and pasted all of the referenced code. I removed the background-size contain !important code. I put in my background-image media queries for all three image sizes and double checked the file names. Absolutely nothing has changed all along the way. I double checked to make sure my editor is actually updating the css file. My smartphone is not even pulling the custom image, let alone any padding possible issues. Any Ideas?

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.