- This topic has 19 replies, 6 voices, and was last updated 5 years, 4 months ago by
Leo.
-
AuthorPosts
-
September 7, 2017 at 5:24 pm #381377
Xavier Verhoeven
I love the way Page Headers can be applied to global locations, but I can’t figure out how I can add them to author pages (eg http://khq.dietdigital.com.au/our-people/amy-buckley/). This is set up using an author.php template β is there a way I can call the page header from the template?
I want a Page Header that sits behind the nav area, so it’s not something I can easily hardcode the HTML for.
Any pointers would be much appreciated, or if it’s something that can be added to the plugin, that would be even better!
September 8, 2017 at 12:16 am #381480Tom
Lead DeveloperLead DeveloperHi there,
Currently you would have to do something custom for this, but I love the idea. I’ve made note of it to add to the Page Headers add-on.
Let me know if you need more info on the custom solution π
September 8, 2017 at 4:53 pm #382035Xavier Verhoeven
Thanks Tom. A tip on the best way to implement this would be great. Seems like I’d need to hack at a couple of files in the plugin to get it working, which wouldn’t be ideal.
September 9, 2017 at 12:28 am #382132Tom
Lead DeveloperLead DeveloperCurrently you would have to build your own page header without the plugin, then hook it into the author page.
Less than ideal – I’ll see if I can bake this into the next version (no promises) π
September 9, 2017 at 3:49 am #382213Xavier Verhoeven
That would be awesome! I know it’s a bit of an edge case, but I feel like it makes as much sense as having global locations for post types – just that authors isn’t quite a post type.
I’ll wait and see. If I need to implement before it’s there, I’ll just have to do it manually.
Thanks again. I’m a big GP fan.
February 23, 2018 at 9:07 am #503863Katie Jones
Hi all – +1 on this (and as always, +1 on how much I love this theme!). Has this been done yet, or any pointers to someone who did it?
Thanks!
February 23, 2018 at 9:19 pm #504259Tom
Lead DeveloperLead DeveloperThis hasn’t been done yet, but will be soon.
GPP 1.6 is close, and this might not make it in. However, there is a new filter meaning we can easily create a Page Header and place it anywhere with a simple conditional π
February 25, 2018 at 4:30 am #505063Katie Jones
Sweet, good to know! Thanks, Tom!
February 25, 2018 at 11:43 am #505354Tom
Lead DeveloperLead DeveloperNo problem! Ping me back in here once 1.6 is released and I’ll share the code π
February 25, 2018 at 12:25 pm #505396Katie Jones
Sweet, thanks! π
April 2, 2018 at 10:27 am #538863Colby
Hello,
Just used GP premium for the first time, on a new build. It’s really great, nice work.Is there a filter snippet anyone can share to place the page header in the aforementioned pages?
thanks!
April 2, 2018 at 5:32 pm #539180Leo
StaffCustomer SupportHi there,
This should work with GPP1.6
add_filter( 'generate_page_header_id', function( $id ) { if ( is_author() ) { return 17686; // ID of the Page Header to use. } return $id; } );
April 3, 2018 at 5:22 am #539615Colby
Thanks Leo, i’ll give that a try!
April 3, 2018 at 9:18 am #539945Leo
StaffCustomer SupportNo problem!
April 3, 2018 at 2:25 pm #540250Colby
The snippet worked great, thanks!
I ended up using it for bbpress also, i was able to assign the page header to the main pages for bbpress through the global locations in the admin, with the exception of the profile page of the BB user. So i adapted the snippet above as follows and it works (just posting here in case anyone else runs into the same scenario).
Swapped “is_author()” with “is_bbpress()”
add_filter( ‘generate_page_header_id’, function( $id ) {
if ( is_bbpress() ) {
return 17686; // ID of the Page Header to use.
}return $id;
} ); -
AuthorPosts
- You must be logged in to reply to this topic.