Archived topic
Add page code to all pages
21 replies · Started by Charles on March 10, 2021
Hello!
I have some WP page code I'd like to hook into all of my posts and pages. Can you help me figure out how to do that?
Thanks.
Hi there,
you can use a Hook Element:
https://docs.generatepress.com/article/hooks-element-overview/
How can I put the page directly into the hook block? Do I have to copy the .html?
Not all aspects of my page seem to work when I do that.
What is the Page code you're trying to add ? Do you have a link to a page where it is visible ?
This part, which is an accordion block from a plugin, doesn't seem to work through the hoodk:
<!-- wp:ub/content-toggle-block {"blockID":"101e7bad-8fc6-4017-beb0-5109294ee5ef","theme":"#abb8c3","titleColor":"#000000","border":false} -->
<!-- wp:ub/content-toggle-panel-block {"parentID":"101e7bad-8fc6-4017-beb0-5109294ee5ef","theme":"#abb8c3","collapsed":true,"titleColor":"#000000","panelTitle":"\u003cstrong\u003eView All Sections\u003c/strong\u003e","titleTag":"h2","border":false} -->
The code works correctly on this page
https://gconntest1.wpengine.com/test2/
But not when it's added through the hook on this page:
I assume that is built using a Block - if so then use the Block Element instead of the Hook Element - you can build directly using blocks:
https://docs.generatepress.com/article/block-element-overview/
I don't get a block choice -- header, hook, layout only.
Are you using the latest GP Premium version 1.12.3?
Looks like my theme is Generatepress 3.0.3.
I'm talking about the GP Premium plugin:
https://docs.generatepress.com/article/generatepress-and-gp-premium/
I tried to upload but I get this error:
The package could not be installed. The theme is missing the style.css stylesheet.
GP Premium is a plugin:
https://docs.generatepress.com/article/missing-style-css/
Please take another look at the article I linked above which explains the differences between GeneratePress and GP Premium.
Hi Charles,
In the article Leo linked, there's a link which has step by step instruction on how to install GP Premium:
https://docs.generatepress.com/article/installing-gp-premium/
Have a look and try to follow the steps.
Let me know :)
Oh, right it's a plugin :)