Site logo

Archived topic

My live page doesn't look the same like in editor

19 replies · Started by Violeta on November 23, 2020

Viewing posts 16–20 of 20

oooh ... ok - its never a good idea to edit the parent theme files, aside of things going a bit weird any changes you make will be overwritten when the theme is updated.

Could you remove those changes ?

We can help with adding the code without editing theme files afterwards :)

Both removed and it looks like that was a problem.

As I said I'm pretty new to WP, but on my previous site that I ran on a different theme I used theme editor to add codes.

Anyways, I am so happy we found the problem.:)

I guess I will activate my plugins now. And can you please help me to add the codes for Google Analytics and Skimlinks back? As well, I would like to know how to add codes without editing the theme for the future.

Phew.... glad that resolved it - And no problems, theres a lot of nuances with WP and different Themes :)

Yep, you can re-activate your plugins.

Ok adding code to the themes templates such as the Header or the Footer, you can use the Hook Element:

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

1. Go to Appearance > Elements.
2. Create a new Hook element
3. Insert your code
4. Select the Hook where you need to add the code, options:

a. wp_head - insert inside the <header> tags
b. wp_footer - insert into footer - immediately before the closing </body> tag
c. wp_body_open - insert immediately after the opening <body> tag

5. Set the elements Display Rule Locations to Entire Site

I would recommend creating a separate Hook for each script you want to add, even if they are using the same hook, makes it easier to debug if one code is not working.

For other codes like PHP snippets, that you may be tempted to add to the themes functions.php, we explain how in this article:

https://docs.generatepress.com/article/adding-php/

CSS best place for it unless you're adding a lot ( 100's of lines ) is in the Customizer > Additional CSS. You may find some already in there that came with the Site Library import

David, all done. Codes have been added to the hook elements.

Thank you so much for all of your help!

Happy to be of help!

This archived topic is closed to new replies.