- This topic has 10 replies, 3 voices, and was last updated 4 years ago by
Tom.
-
AuthorPosts
-
February 13, 2017 at 1:42 pm #278322
Sebastian
Hi Tom, Hi Leo,
I would like to include an ACF field
<?php the_field('text'); ?>
in the “Page Header” (combined with site header). The ACF field should be inside the “div class: inside-page-header”. Is there a way to integrate this using functions.php?Regards, Sebastian
GeneratePress 1.3.44GP Premium 1.2.94February 13, 2017 at 2:09 pm #278341Leo
StaffCustomer SupportHi Sebastian,
I think you would use GP hooks for that: https://docs.generatepress.com/article/hooks-overview/.
Take a look at where they are located: http://demo.generatepress.com/hook-locations/
Both
before header content
andafter header content
are inside header.Let me know if this works
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/February 13, 2017 at 2:17 pm #278344Sebastian
Hi Leo, Thanks your quick response. I mean, inside the generated Page Header from GP Premium. The Content is enclosed by the class “create-inside-combined-content”. Inside this class i would linke put the ACF Field. You know what I mean?
February 13, 2017 at 2:44 pm #278361Leo
StaffCustomer SupportDid you try before header content hook?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/February 13, 2017 at 3:08 pm #278371Sebastian
Yes I tried. But it is not the right place.
February 13, 2017 at 3:14 pm #278375Leo
StaffCustomer SupportIs your site live by any chance?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/February 13, 2017 at 7:37 pm #278439Tom
Lead DeveloperLead DeveloperYou could use the Page Header area, but you would first have to create a new shortcode with your custom fiend.
add_shortcode( 'your_shortcode_tag','sebastian_acf_shortcode' ); function sebastian_acf_shortcode() { ob_start(); ?> Your custom field/HTML in here <?php return ob_get_clean(); }
Then you would add [your_shortcode_tag] into the page header content area.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentFebruary 15, 2017 at 2:56 am #278994Sebastian
Hi Tom, many thanks for the support.
This is a very good solution, but for a customer website another solution would be better. Is there any way to solve this problem using functions.php?
February 15, 2017 at 10:56 am #279229Tom
Lead DeveloperLead DeveloperThere’s the
generate_inside_merged_page_header
hook which might help.Looks like that’s the only hook inside Page Header at the moment.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentFebruary 17, 2017 at 8:59 am #280235Sebastian
Yes, I have seen. But the content appears above the navigation. Will you perhaps add another hook in the future?
February 19, 2017 at 12:00 am #280818Tom
Lead DeveloperLead DeveloperI’ll see what I can do 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.