• Hi there,

    So I recently migrated my blog, and updated the header image to match my new domain. However, when I log into my website from mobile, the header image that is bbeing shown belongs to my previous domain.

    I am attaching the screenshots of both desktop as well as from mobile device.

    So far, I have cleared the cache of the website, reuploaded the image to see if it fixes, tried to check from different mobile phones, but no avail.

    I don’t know why is this happening. Can you please help me out with this:

    Image of new header (shown in desktop): https://ibb.co/fxQd0rC

    Image of old header (shown in mobile phone):https://ibb.co/9pk532G

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 16 total)
  • Hi,

    Are you using GP Premium? You seem to have Mobile Header enabled which is a GP Premium option.

    I’m afraid we aren’t allowed to support it here – it’s a WordPress rule.

    We would be happy to take a look if you open a support topic in our premium forum:
    https://generatepress.com/support/

    Thanks!

    Thread Starter bestblogger1

    (@bestblogger1)

    Hi Ejcabquina,

    No, I’m not using Generatepress premium.

    Infact, I didn’t even know about such feature, so I googled it and found about it. There is no option in my header setting for mobile header.

    Screenshot of the view: https://ibb.co/D8cXwJt

    This only appeared after I migrated my domain and copied all the files from my previous domain (no, I wasn’t using GP Premium in my previous domain as well)

    Please help me out with this. I have observed that the mobile image remains constant. So even if I change the header image with a different one, it shows the same old image from my previous domain in mobile.

    Thanks!

    Leo

    (@leohsiang)

    That definitely looks like some sort of caching issue.

    Looks like you’ve already resolved it though?

    I’m seeing the same image on desktop and mobile now:
    https://www.screencast.com/t/XYEPcYRb1Zp
    https://www.screencast.com/t/RmK0AU0egEk

    Thread Starter bestblogger1

    (@bestblogger1)

    Hi Leo,

    The issue is not in mobile view, but in mobile devices. I mean to say that if somebody accesses my website from mobile, they see a very different header.

    I have cleared all my cache, in both devices plus also disabled all plugins to cross-check. But still the issue is persisting.

    Here, I am sharing the latest screenshot from my mobile device. Plus I have also tried to check the website from other mobile phones to cross verify, and the issue is persisting. So on all mobile devices, this header is being shown.

    Link: https://ibb.co/m07zVbv

    This image belongs to my previous domain. I have copied all the files from my previous domain (where I used generatepress). So no even I change any header image, the updated one is shown in the desktop but when someone accesses the website through mobile, the see teh header image that was a part of my old domain (refer to the screenshot link)

    This is the weirdest bug I’ve seen so far. Please help me with this.

    THanks!

    Leo

    (@leohsiang)

    I’m seeing the issue but it’s not really a theme bug.

    It’s tough to help as the mobile simulator doesn’t show the issue.

    I have copied all the files from my previous domain (where I used generatepress).

    Maybe the problem comes from that process?

    It might be worth checking with your hosting support to see if they have any idea as of why this is happening.

    The theme itself doesn’t have the ability to pull the image from another domain.

    Thread Starter bestblogger1

    (@bestblogger1)

    The issue is sorted thanks!

    I have one more issue, I am using Generatepress child theme. So the theme folder only contains style.css and function.php file.

    I want to edit the header.php file, but can’t find it in the genratepress child theme folder. However, it is present in the main generatepress theme folder.

    So if I want to do some changes in the header php file, should I first copy it from the main generatepress folder, paste it to the generatepress child folder and then make the edit,

    Or should I directly make changes in the header.php file in the main generatepress theme folder and it would automatically reflect it in the child theme?

    Thanks!

    Hi there,

    you should never edit the Parent Theme files.
    Instead copy the header.php file to your Child Theme and make your modifications there.

    If you simply want to add code inside the header such as a Google analytics script then you can use a Hook function in your Child Themes functions.php

    example:

    add_action( 'wp_head', function() {
    ?>
    // Add your code here 
    <?php
    }); 
    Thread Starter bestblogger1

    (@bestblogger1)

    Hi David,

    That’s precisely what I wanted to achieve.

    So I added my analytics code to the funcions php, along with the code that you shared.

    The thing is, my tracking code is now publicly displayed above the header image, and I don’t want it to appear publically. Is there any way to conceal that?

    For reference, you can visit my site (it’s the same for which I seeked help in this thread)

    Thanks!

    • This reply was modified 4 years, 2 months ago by bestblogger1.
    Leo

    (@leohsiang)

    It shouldn’t. Are you referring to the UA-178889386-1 text?

    Thread Starter bestblogger1

    (@bestblogger1)

    Yes!

    Leo

    (@leohsiang)

    Can you copy and paste the code you’ve added here?

    Make sure to highlight the content and click the CODE button in the editor.

    Thread Starter bestblogger1

    (@bestblogger1)

    add_action( 'wp_head', function() {
    ?>
    UA-178889386-1
    <?php
    });
    • This reply was modified 4 years, 2 months ago by bestblogger1.
    Leo

    (@leohsiang)

    Hmm that code isn’t PHP at all – it’s just a simple text string.

    Where did you get that from and are there any instructions on how to add it?

    Thread Starter bestblogger1

    (@bestblogger1)

    I got this code from David, he shared this code in this thread – where I asked if I could make alteration in the main theme’s headerphp as I needed to add the google analytics code, so he said that I could use a hook function,and then he shared the code.

    so I thought this must be the code for adding the analytics in header php

    That’s why I added it. But it seems that it was just a sample code. can you share what should I do if I need to add a google analytics tracker code in my wordpress?

    Leo

    (@leohsiang)

    David’s code shouldn’t be the issue here.

    The problem is the string here: UA-178889386-1

    The analytics code should look something like this:
    https://developers.google.com/analytics/devguides/collection/analyticsjs

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Different header in mobile and desktop’ is closed to new replies.