Archived topic
Elements and hooks - container, php shortcode for gravity form on cpt single pos
5 replies · Started by Brad on July 1, 2022
Hi,
Looking to to something similar to this I believe:
https://generatepress.com/forums/topic/hook-and-php/
This is what I've tried:
(Please see screenshot) Note: Background of inner container is white.
https://www.dropbox.com/s/s9rbgvavo9bd2ie/generatepress__hook_p-h-p__shortcode.jpg?dl=0
Thoughts on the easiest, most efficient way to achieve this? Previously I was just hard coding it the the custom post type template file but then I'd have to create a div, css, media queries, etc.
Sincere thanks for your suggestions. Hope all is well.
Brad
_________________
Shortcode code:
[gravityform id="1" title="false" description="false"]
<?php gravity_form(1, false, false, false, '', true, 12); ?>
Hi Brad,
Sorry I'm not sure what you are trying to achieve here from the description above.
Do you have an example?
Ok. I actually got it to work
https://staging-armandos.j66labs.co/bmw-model/bmw-all-other-models/
Quick question:
Can you put php in element containers somehow, insert them via hooks to templates?
Creating a shortcode is a more common solution:
https://docs.generatepress.com/article/creating-a-shortcode/
Huh… thanks
No problem :)