[Resolved] Function file and header.php changes after update

Home Forums Support [Resolved] Function file and header.php changes after update

Home Forums Support Function file and header.php changes after update

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #798440
    Anton

    Hello guys!

    I just updated Generatepress and realized that all my stuff in function.php and header.php disappeared.

    In function.php I have the following code to get rid of the URL that gets created in buttons: https://docs.generatepress.com/article/generate_more_jump/

    In header.php I have my Google analytics code.

    Is there an easier way to do this? It gets quite time consuming adding everything back on every site. Hopefully there is a better way of doing it without having to use a bunch of plugins.

    Thanks in advance and hat off for a great theme!

    #798562
    David
    Staff
    Customer Support

    Hi there,

    you should use a Child Theme for adding functions, as these will not be overwritten on theme update. Alternatively the Code Snippets Plugin. This article covers:
    https://docs.generatepress.com/article/adding-php/

    For GA Codes and other stuff you need to add the WP_Head you can use the Hook Element:

    https://docs.generatepress.com/article/hooks-element-overview/

    #798570
    Anton

    Hi David,

    Thank you for your reply.

    I am using a child theme, the “Marketer” one. But my function and header got over-written anyway. Or isn’t Marketer a child theme?

    #798578
    David
    Staff
    Customer Support

    No, the Library Sites such as marketer just import GP Settings etc. not a child theme.

    #798585
    Anton

    Affirmative.

    Thanks a lot for the help, David.

    Have a good weekend!

    Best regards,
    Anton

    #798590
    David
    Staff
    Customer Support

    You’re welcome. Have a good weekend too!

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