[Resolved] Using child-theme on a file in the “generatepress/inc/structure” folder

Home Forums Support [Resolved] Using child-theme on a file in the “generatepress/inc/structure” folder

Home Forums Support Using child-theme on a file in the “generatepress/inc/structure” folder

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1316510
    sharcs

    Hi,

    I’m trying to add a new widget area next to the logo on the header. To do this, I’m editing the header.php file located on the generatepress\inc\structure folder.

    The issue that I’m having is I have no idea on how to get this file working on the child theme. I can edit it on the parent theme no problem, but when I create a similar folder structure for it on my child theme, it just doesn’t work.

    So my question, how do I get this file to work on my child theme?

    Thank you.

    #1316960
    Leo
    Staff
    Customer Support

    Hi there,

    By default WordPress only allows the top level files to be overwritten.

    We should be able to use the default header widget area and some CSS to re-position the widget instead of creating a new widget area though:
    https://docs.generatepress.com/article/header-widget/

    #1317246
    sharcs

    Thanks for the reply.

    Could you please tell where to put the new widget code on the main header file?

    Usually I just paste the code on where I want the widget to appear, but the only place to paste the code on the main header file is either before the secondary or after the primary navigation. Everything inside the header is controlled by the other header file in the “generatepress/inc/structure” folder that I mentioned earlier.

    I’m sorry but I’m not very good at PHP, but if you give me the code and tell me where to paste it, I can figure the rest out myself.

    Thank you

    #1317352
    Leo
    Staff
    Customer Support

    Have you tried using the existing header widget area instead of creating a new widget area at the same place?
    https://docs.generatepress.com/article/header-widget/

    #1317364
    sharcs

    Oh wow, this is embarrassing. I’ve built like 5 sites on this theme and never noticed that there’s a header widget.

    For what it’s worth, thank you for pointing it out and my apologies for wasting your time with my stupidity.

    Thanks.

    #1318140
    Leo
    Staff
    Customer Support

    No problem 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.