[Resolved] How can I change header.php in child theme?

Home Forums Support [Resolved] How can I change header.php in child theme?

Home Forums Support How can I change header.php in child theme?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1256316
    Lee

    I installed child theme provided by GP.

    [First question]
    I want to add a specific tag to the code in header.php.
    For example

    <body <? php body_class (); ?> <? php generate_do_microdata (‘body’); ?>>

    <body <? php body_class (); ?> <? php generate_do_microdata (‘body’); ?> oncontextmenu = “return false” ondragstart = “return false” onselectstart = “return false”>

    I want to change the code above to the code below.
    Currently, the generatepress_child folder contains only functions.php, style.css, and screenshot.png.
    How do I change a specific part of header.php?

    Can I change only what I want?
    I would like to fix the problem by changing the php without using plugins and GP elements.

    [Second question]
    I installed child theme provided by GP.

    If you add the style code to style.css in the child theme folder, will the style.css of the parent theme be read first and then the style.css of the child theme?

    I want to add the completed style code to the style.css of the child theme without using the CSS plugin because the site’s style code is complete.

    #1256703
    Leo
    Staff
    Customer Support

    Hi there,

    1. You’d need to copy the original header.php file and paste it into the child theme folder then edit the code here:
    https://github.com/tomusborne/generatepress/blob/master/header.php

    2.

    If you add the style code to style.css in the child theme folder, will the style.css of the parent theme be read first and then the style.css of the child theme?

    Yes that’s how child theme works.

    #1257070
    Lee

    Thanks for the answer.

    #1258259
    Leo
    Staff
    Customer Support

    No problem 🙂

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